/* --- Global Settings --- */
:root {
    --primary-bg: #282828; /* Dark Grey */
    --secondary-bg: #f4f4f4; /* Light Grey for contrast */
    --text-light: #ffffff;
    --text-dark: #333333;
    --accent-color: #a08230; /* Deep Yellow accent, great for a classic barbershop feel */
    --accent-color-rgb: 160, 48, 48; /* RGB version for rgba() */
    --accent-hover: #c06f40; /* Slightly lighter orange for hover */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --container-width: 1140px;
    --transition-speed: 0.4s;
}

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

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

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--secondary-bg);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-bg);
}

h1 { font-size: 3.5rem; line-height: 1.2; }
h2 { font-size: 2.5rem; line-height: 1.3; }
h3 { font-size: 1.75rem; line-height: 1.4; }

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--accent-hover);
}

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

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem; /* Padding for smaller screens */
}

.section-padding {
    padding: 6rem 0;
}

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

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: center;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 0.8rem 2rem;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: var(--accent-hover);
    color: var(--text-light);
    transform: translateY(-3px);
}

.cta-button i {
    margin-right: 0.5rem;
}

.section-tag {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.section-title {
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 0.5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
}
.text-center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

/* --- Accessibility Focus --- */
*:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.5);
    border-radius: 3px;
}
.nav-link:focus-visible {
    box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.6);
}


/* --- Header --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(40, 40, 40, 0.9);
    backdrop-filter: blur(5px);
    padding: 1rem 0;
    transition: background-color var(--transition-speed) ease, padding var(--transition-speed) ease;
}

#header.scrolled {
    background-color: rgba(40, 40, 40, 0.98);
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-light);
    letter-spacing: -1px;
}
.logo span {
    color: var(--accent-color);
}
.logo:hover {
    color: var(--text-light);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-light);
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition-speed) ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-speed) ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

#menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    margin: 5px 0;
    transition: all var(--transition-speed) ease;
}


/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--primary-bg);
    background-image: linear-gradient(rgba(40, 40, 40, 0.8), rgba(40, 40, 40, 0.8)), url('images/hero-bg.jpg'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-light);
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem; 
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.animate-on-load.visible .hero-title { animation: slideInUp 0.8s ease-out forwards; }
.animate-on-load.visible .hero-subtitle { animation: slideInUp 0.8s ease-out 0.2s forwards; }
.animate-on-load.visible .cta-button { animation: slideInUp 0.8s ease-out 0.4s forwards; }

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


/* --- About Section --- */
.about-section {
    background-color: var(--text-light);
}

.about-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-content p {
    margin-bottom: 1rem;
}

/* --- Services Section --- */
.services-section {
    background-color: var(--secondary-bg);
}

.services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-item {
    background-color: var(--text-light);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.service-icon i { 
    color: var(--accent-color);
    font-size: 2.5rem;
}

.service-item h3 {
    color: var(--primary-bg);
    font-size: 1.5rem; 
    margin-bottom: 0.75rem;
}

.service-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 1rem;
}

.service-item p {
    font-size: 0.95rem;
    color: #555; 
    line-height: 1.6;
}

.services-cta {
    margin-top: 3rem;
}
.services-cta p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}


/* --- Gallery Section (was Portfolio) --- */
.portfolio-section {
    background-color: var(--text-light);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}


.portfolio-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.portfolio-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(40, 40, 40, 0.7);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-item:hover .overlay {
    opacity: 1;
}

/* --- Contact Section --- */
.contact-section {
    background-color: var(--secondary-bg);
}

.contact-details {
    align-items: flex-start; 
}

.contact-info h3, .contact-form h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-bg);
}

.contact-info p {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.contact-info i {
    color: var(--accent-color);
    margin-right: 1rem;
    width: 20px; 
    text-align: center;
    font-size: 1.2rem;
}

.contact-info a {
    color: var(--text-dark);
    font-weight: 600;
    transition: color var(--transition-speed) ease;
}
.contact-info a:hover {
    color: var(--accent-color);
}

.contact-form p {
    margin-bottom: 1.5rem;
}


/* --- Footer --- */
.footer-section {
    background-color: var(--text-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 0;
    text-align: center;
}

.footer-content p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-social {
    margin-bottom: 1rem;
}

.footer-social a {
    color: var(--text-light);
    font-size: 1.8rem;
    margin: 0 0.7rem;
    transition: color var(--transition-speed) ease;
}

.footer-social a:hover {
    color: var(--accent-color);
}

/* --- Lightbox --- */
.lightbox {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show { display: flex; opacity: 1; }
.lightbox-content { position: relative; max-width: 90%; max-height: 90%; text-align: center; }
.lightbox-content img { max-width: 100%; max-height: 85vh; height: auto; display: block; margin: 0 auto; border-radius: 5px; }
.lightbox-caption { color: var(--text-light); margin-top: 0.5rem; font-size: 1rem; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: absolute; background: none; border: none; color: var(--text-light); font-size: 2.5rem; cursor: pointer; transition: opacity var(--transition-speed) ease; opacity: 0.7; z-index: 1101; padding: 0.25rem 0.5rem; border-radius: 4px; }
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-close { top: 1rem; right: 1.5rem; font-size: 3rem; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }


/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--accent-color);
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease, background-color var(--transition-speed) ease;
    z-index: 999;
}

.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background-color: var(--accent-hover); color: var(--text-light); }

/* --- Scroll Animations --- */
.animate-on-scroll, .animate-on-load {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-on-scroll.fade-in, .animate-on-load.fade-in { transform: translateY(30px); }
.animate-on-scroll.fade-in-up, .animate-on-load.fade-in-up { transform: translateY(50px); }
.animate-on-scroll.fade-in-left, .animate-on-load.fade-in-left { transform: translateX(-50px); }
.animate-on-scroll.fade-in-right, .animate-on-load.fade-in-right { transform: translateX(50px); }
.animate-on-scroll.visible, .animate-on-load.visible { opacity: 1; transform: translate(0, 0); }


/* --- Responsive Design --- */
@media (max-width: 992px) {
    :root { --container-width: 960px; }
    h1, .hero-title { font-size: 3rem; }
    h2 { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.3rem; }
}

@media (max-width: 768px) {
    html { font-size: 15px; }
    h1, .hero-title { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .section-padding { padding: 4rem 0; }
    #menu-toggle { display: block; }
    .nav-menu { position: fixed; top: 0; right: -100%; width: 70%; max-width: 300px; height: 100vh; background-color: var(--primary-bg); flex-direction: column; justify-content: center; align-items: center; transition: right var(--transition-speed) ease-in-out; padding-top: 5rem; box-shadow: -5px 0 15px rgba(0,0,0,0.2); }
    .nav-menu.active { right: 0; }
    .nav-link { font-size: 1.2rem; margin: 1rem 0; display: block; text-align: center; }
    .nav-link::after { left: 50%; transform: translateX(-50%); }
    #menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    #menu-toggle.active span:nth-child(2) { opacity: 0; }
    #menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    .grid-2 { grid-template-columns: 1fr; gap: 3rem; }
    .about-image { order: -1; margin: 0 auto 2rem auto; max-width: 350px; }
    .about-content { text-align: center; }
    .about-content .section-title::after { left: 50%; transform: translateX(-50%); }
    .contact-details { grid-template-columns: 1fr; }
    .contact-info, .contact-form { text-align: center; }
    .contact-info p { justify-content: center; }
    .lightbox-prev, .lightbox-next { font-size: 2rem; }
    .lightbox-close { font-size: 2.5rem; top: 0.5rem; right: 1rem;}
}

@media (max-width: 576px) {
    html { font-size: 14px; }
    h1, .hero-title { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .container { padding: 0 1rem; }
    .section-padding { padding: 3rem 0; }
    .portfolio-grid { grid-template-columns: 1fr; } 
    .portfolio-item img { height: 280px; } 
    .service-item { padding: 1.5rem; }
    .service-item h3 { font-size: 1.3rem; }
    .back-to-top { bottom: 1rem; right: 1rem; width: 35px; height: 35px; font-size: 1rem;}
}