/* ===================================
   Joe Jarvis Carpets - Custom Styles
   Fresh & Airy | Forest Green + Off-White
   =================================== */

/* --- CSS Variables --- */
:root {
    --forest-green: #166534;
    --forest-green-light: #228B22;
    --forest-green-dark: #0F5132;
    --off-white: #FAFAF7;
    --cream: #F5F5F0;
    --warm-gray: #6B7280;
    --dark-text: #1F2937;
    --light-text: #374151;
    --card-bg: #FFFFFF;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--dark-text);
    background-color: var(--off-white);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Subtle background pattern */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.03;
    background-image: radial-gradient(circle at 25% 25%, var(--forest-green) 1px, transparent 1px),
                      radial-gradient(circle at 75% 75%, var(--forest-green) 1px, transparent 1px);
    background-size: 60px 60px;
}

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

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

ul {
    list-style: none;
}

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

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-text);
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--forest-green);
    background: rgba(22, 101, 52, 0.08);
    padding: 8px 16px;
    border-radius: 50px;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--warm-gray);
    max-width: 600px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header .section-subtitle {
    margin: 0 auto;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--forest-green);
    color: #fff;
    border-color: var(--forest-green);
}

.btn-primary:hover {
    background: var(--forest-green-dark);
    border-color: var(--forest-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(22, 101, 52, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--forest-green);
    border-color: var(--forest-green);
}

.btn-secondary:hover {
    background: var(--forest-green);
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--forest-green);
    border-color: var(--forest-green);
}

.btn-outline:hover {
    background: var(--forest-green);
    color: #fff;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(250, 250, 247, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--forest-green);
}

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

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

.nav ul {
    display: flex;
    gap: 32px;
}

.nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--light-text);
    position: relative;
}

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

.nav a:hover {
    color: var(--forest-green);
}

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

.nav-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-text);
    padding: 8px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--forest-green);
    padding: 8px;
}

/* --- Hero Section --- */
.hero {
    padding: 140px 0 100px;
    background: linear-gradient(135deg, var(--off-white) 0%, #E8F5E9 50%, var(--cream) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(22, 101, 52, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--forest-green);
    background: rgba(22, 101, 52, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--dark-text);
}

.text-gradient {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--forest-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--warm-gray);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 480px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    min-height: 500px;
}

.hero-main-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-main-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.hero-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
}

.hero-card-stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Floating Cards */
.floating-card {
    position: absolute;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}

.floating-icon {
    width: 44px;
    height: 44px;
    background: rgba(22, 101, 52, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.floating-number {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--forest-green);
    line-height: 1.2;
}

.floating-label {
    display: block;
    font-size: 0.75rem;
    color: var(--warm-gray);
    line-height: 1.3;
}

.floating-card-1 {
    top: 20px;
    left: -30px;
    animation-delay: 0s;
}

.floating-card-2 {
    bottom: 80px;
    right: -20px;
    animation-delay: 1s;
}

.floating-card-3 {
    bottom: -10px;
    left: 20px;
    animation-delay: 2s;
}

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

/* --- About Section --- */
.about {
    padding: 100px 0;
    background: var(--off-white);
}

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

.about-images {
    position: relative;
}

.about-img-main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

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

.about-img-secondary {
    position: absolute;
    bottom: -40px;
    right: -40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 6px solid var(--off-white);
}

.about-img-secondary img {
    width: 280px;
    height: 200px;
    object-fit: cover;
}

.about-content .section-tag {
    margin-bottom: 16px;
}

.about-text {
    color: var(--warm-gray);
    margin-bottom: 16px;
    line-height: 1.8;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--dark-text);
}

.feature-icon {
    width: 32px;
    height: 32px;
    background: rgba(22, 101, 52, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Services Section --- */
.services {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--cream) 0%, var(--off-white) 100%);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 36px 28px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(22, 101, 52, 0.2);
}

.service-icon {
    width: 64px;
    height: 64px;
    background: rgba(22, 101, 52, 0.08);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--forest-green);
}

.service-card:hover .service-icon svg {
    stroke: #fff;
}

.service-card h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark-text);
}

.service-card p {
    color: var(--warm-gray);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- Gallery Section --- */
.gallery {
    padding: 100px 0;
    background: var(--off-white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
}

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

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(22, 101, 52, 0.8));
    display: flex;
    align-items: flex-end;
    padding: 24px;
    opacity: 0;
    transition: var(--transition);
}

.gallery-overlay span {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

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

/* --- CTA Section --- */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--forest-green-dark) 0%, var(--forest-green) 50%, var(--forest-green-light) 100%);
}

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

.cta-content h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #fff;
    margin-bottom: 20px;
}

.cta-content p {
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cta-buttons .btn-primary {
    background: #fff;
    color: var(--forest-green);
    border-color: #fff;
}

.cta-buttons .btn-primary:hover {
    background: var(--cream);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.cta-buttons .btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.cta-buttons .btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}

.cta-visual {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.cta-visual img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* --- Contact Section --- */
.contact {
    padding: 100px 0;
    background: var(--off-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-description {
    color: var(--warm-gray);
    margin-bottom: 32px;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: rgba(22, 101, 52, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item strong {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--forest-green);
    margin-bottom: 4px;
}

.contact-item p {
    color: var(--dark-text);
    font-size: 0.95rem;
}

.contact-item a {
    color: var(--dark-text);
}

.contact-item a:hover {
    color: var(--forest-green);
}

.map-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--warm-gray);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--dark-text);
    background: var(--off-white);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--forest-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Success Message */
.form-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(22, 101, 52, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.form-success h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--forest-green);
}

.form-success p {
    color: var(--warm-gray);
}

/* --- Footer --- */
.footer {
    background: var(--forest-green-dark);
    color: rgba(255,255,255,0.8);
    padding: 80px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 48px;
    padding-bottom: 60px;
}

.footer .logo {
    color: #fff;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.8;
}

.footer-links h4,
.footer-contact h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    margin-bottom: 20px;
}

.footer-links ul,
.footer-contact ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a,
.footer-contact a {
    font-size: 0.9rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover,
.footer-contact a:hover {
    opacity: 1;
    color: #fff;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom p {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* --- Scroll Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Mobile Responsive --- */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero-visual {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .about-grid {
        gap: 40px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--off-white);
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 40px;
        box-shadow: var(--shadow-lg);
        transition: right 0.3s ease;
        z-index: 1001;
    }
    
    .nav.open {
        right: 0;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 24px;
        margin-bottom: 32px;
    }
    
    .nav a {
        font-size: 1.1rem;
    }
    
    .nav-close {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero {
        padding: 120px 0 80px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        justify-content: center;
    }
    
    .floating-card {
        display: none;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-img-secondary {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 20px;
    }
    
    .about-img-main img,
    .about-img-secondary img {
        height: 300px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .cta-card {
        grid-template-columns: 1fr;
    }
    
    .cta-visual {
        order: -1;
    }
    
    .cta-visual img {
        height: 250px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-form-wrapper {
        padding: 28px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item img {
        height: 250px;
    }
    
    .about-features {
        grid-template-columns: 1fr;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}
