/* ===== CSS Variables ===== */
:root {
    /* Stone and Lime Mortar Inspired Colors */
    --limestone: #e8e2d5;
    --flint-dark: #4a4a4a;
    --flint-medium: #6b6b6b;
    --mortar-light: #f5f2ed;
    --mortar-cream: #faf8f3;
    --chalk-white: #fefdfb;
    --sandstone: #c4b5a0;
    --clay-red: #a67c52;
    --moss-green: #7a8450;
    
    /* Applied Colors */
    --primary-color: var(--flint-dark);
    --secondary-color: var(--clay-red);
    --accent-color: var(--moss-green);
    --text-dark: #3a3a3a;
    --text-light: #666666;
    --bg-light: var(--mortar-light);
    --bg-white: var(--chalk-white);
    --border-color: var(--limestone);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(196, 181, 160, 0.03) 35px, rgba(196, 181, 160, 0.03) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(232, 226, 213, 0.03) 35px, rgba(232, 226, 213, 0.03) 70px);
    pointer-events: none;
    z-index: -1;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--sandstone), var(--clay-red));
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

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

a:active {
    color: var(--secondary-color);
}

/* ===== Header & Navigation (Mobile First) ===== */
#head {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

#head.scrolled {
    box-shadow: var(--shadow-md);
}

#logo {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

#logo img {
    max-height: 50px;
    width: auto;
    transition: var(--transition);
}

/* Mobile Navigation */
.nav-container {
    position: relative;
}

.mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 1rem;
    top: -60px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle:active {
    color: var(--accent-color);
}

ul.topnav {
    list-style: none;
    background: var(--bg-white);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

ul.topnav.responsive {
    max-height: 500px;
    box-shadow: var(--shadow-md);
}

ul.topnav li {
    border-bottom: 1px solid var(--border-color);
}

ul.topnav li:last-child {
    border-bottom: none;
}

ul.topnav li a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

ul.topnav li a:active {
    background: var(--bg-light);
    color: var(--accent-color);
    padding-left: 2rem;
}

ul.topnav li.number {
    background: var(--bg-light);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

ul.topnav li.number a {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    background: var(--mortar-cream);
    transition: var(--transition);
    position: relative;
    font-weight: 500;
}

ul.topnav li.number a::after {
    content: '→';
    position: absolute;
    right: 1.5rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}

ul.topnav li.number a:last-child {
    border-bottom: none;
}

ul.topnav li.number a:active {
    background: var(--limestone);
    padding-left: 2rem;
    color: var(--clay-red);
}

ul.topnav li.number a:active::after {
    opacity: 1;
    transform: translateX(0);
}

ul.topnav li.number a i {
    margin-right: 0.75rem;
    color: var(--moss-green);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

ul.topnav li.icon {
    display: none;
}

/* ===== Main Content ===== */
#body {
    margin-top: 85px;
}

section {
    padding: 3rem 1rem;
    position: relative;
    overflow: hidden;
}

section:nth-child(even) {
    background: var(--bg-light);
}

.text {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Home Section ===== */
#home {
    background: linear-gradient(135deg, var(--sandstone) 0%, var(--limestone) 50%, var(--mortar-light) 100%);
    color: var(--text-dark);
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

#home h1 {
    color: var(--flint-dark);
}

#home p {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

#home ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

#home ul li {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--clay-red);
    color: var(--text-dark);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

#home ul li:active {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* ===== About Section ===== */
#about {
    background: var(--bg-white);
}

#about .text {
    animation: fadeInUp 0.8s ease-out;
}

#about ul {
    list-style: none;
    margin-top: 2rem;
}

#about ul li {
    background: var(--bg-light);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    border-left: 4px solid var(--moss-green);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

#about ul li:active {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ===== Gallery Section ===== */
#gallery {
    background: var(--bg-light);
}

#images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

#images a {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    background: var(--bg-white);
    transition: var(--transition);
    aspect-ratio: 4/3;
}

#images a::before {
    content: '\f002';
    font-family: 'Font Awesome 5 Free', 'FontAwesome';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 2rem;
    z-index: 2;
    transition: var(--transition);
}

#images a:active::before {
    transform: translate(-50%, -50%) scale(1);
}

#images a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(122, 132, 80, 0.8), rgba(166, 124, 82, 0.8));
    opacity: 0;
    transition: var(--transition);
}

#images a:active::after {
    opacity: 1;
}

#images a:active {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

#images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

#images a:active img {
    transform: scale(1.1);
}

/* ===== Contact Section ===== */
#contact {
    background: linear-gradient(135deg, var(--flint-medium) 0%, var(--flint-dark) 100%);
    color: white;
    text-align: center;
    position: relative;
}

#contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23ffffff" opacity="0.03"/><circle cx="30" cy="30" r="2" fill="%23ffffff" opacity="0.1"/><circle cx="70" cy="70" r="2" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="50" r="1.5" fill="%23ffffff" opacity="0.08"/></svg>');
    background-size: 100px 100px;
}

#contact h1 {
    color: white;
    position: relative;
    z-index: 1;
}

#contact h1::after {
    background: linear-gradient(90deg, var(--limestone), var(--sandstone));
}

#contact p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-info a {
    display: block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    text-decoration: none;
    color: white;
}

.contact-info a:active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.contact-info a i {
    display: block;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--limestone);
}

.contact-info a span {
    color: white;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.contact-info a strong {
    color: var(--limestone);
    font-size: 1.1rem;
}

/* ===== Footer ===== */
#footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
}

#footer p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Tablet Styles (768px+) ===== */
@media screen and (min-width: 768px) {
    #logo img {
        max-height: 60px;
    }
    
    section {
        padding: 4rem 2rem;
    }
    
    #body {
        margin-top: 95px;
    }
    
    #images {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
    
    .contact-info {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Desktop Styles (1024px+) ===== */
@media screen and (min-width: 1024px) {
    #head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 2rem;
    }
    
    #logo {
        border-bottom: none;
        padding: 1rem 0;
    }
    
    #logo img {
        max-height: 70px;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    ul.topnav {
        display: flex;
        align-items: center;
        max-height: none;
        background: transparent;
        box-shadow: none;
    }
    
    ul.topnav li {
        border-bottom: none;
    }
    
    ul.topnav li a {
        padding: 0.75rem 1.5rem;
        border-radius: 8px;
        margin: 0 0.25rem;
        position: relative;
        overflow: hidden;
    }
    
    ul.topnav li a::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 3px;
        background: var(--clay-red);
        transition: var(--transition);
        transform: translateX(-50%);
    }
    
    ul.topnav li a:active::before {
        width: 80%;
    }
    
    ul.topnav li a:active {
        background: var(--bg-light);
        padding-left: 1.5rem;
    }
    
    ul.topnav li.number {
        background: transparent;
        padding: 0;
        margin-left: auto;
        flex-direction: row;
        gap: 1rem;
    }
    
    ul.topnav li.number a {
        display: inline-flex;
        align-items: center;
        margin-left: 0;
        padding: 0.5rem 1rem;
        border-bottom: none;
        background: var(--bg-light);
        border-radius: 8px;
        font-size: 0.9rem;
    }
    
    ul.topnav li.number a:active {
        background: var(--limestone);
        padding-left: 1rem;
        transform: translateY(-2px);
        box-shadow: var(--shadow-sm);
    }
    
    #body {
        margin-top: 90px;
    }
    
    section {
        padding: 5rem 2rem;
    }
    
    #home {
        min-height: 500px;
    }
    
    #images {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* ===== Large Desktop (1440px+) ===== */
@media screen and (min-width: 1440px) {
    .text {
        max-width: 1400px;
    }
}

/* ===== Utility Classes ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Print Styles ===== */
@media print {
    #head {
        position: static;
    }
    
    #body {
        margin-top: 0;
    }
    
    section {
        page-break-inside: avoid;
    }
}