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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #c9a227;
    --accent-color: #8b7355;
    --light-color: #f8f9fa;
    --dark-color: #1a1a1a;
    --text-color: #333;
    --surface-color: #ffffff;
    --card-bg: var(--light-color);
    --muted-text: #666;
    --border-color: #e0e0e0;
    --heading-color: var(--primary-color);
}

/* Dark theme variables applied when `body` has class `dark` */
body.dark {
    --primary-color: #1b2430;
    --secondary-color: #c9a227;
    --accent-color: #6b5a45;
    --light-color: #0b0b0b;
    --dark-color: #f8f9fa;
    --text-color: #e9e9e9;
    --surface-color: #0f161b;
    --card-bg: #0b0f13;
    --muted-text: #bfbfbf;
    --border-color: rgba(255,255,255,0.06);
    --heading-color: var(--text-color);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    transition: background-color 300ms ease, color 300ms ease;
}

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

/* Header */
header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

/* header layout helpers for grid */
.logo { justify-self: start; }
.nav-links { justify-self: center; }
.theme-toggle { justify-self: end; align-self: center; position: static; right: auto; top: auto; transform: none; }

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    margin: 20px 0;
    border-radius: 10px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 300;
    letter-spacing: 1px;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #b8912a;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--dark-color);
    border: 2px solid var(--dark-color);
}

.btn-secondary:hover {
    background-color: var(--dark-color);
    color: var(--primary-color);
}

/* Sections */
section {
    padding: 60px 0;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--heading-color);
    text-align: center;
}

section p {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 30px;
    font-size: 1.1rem;
    /* color: #666; */
}

/* About Section */
.about {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 60px 40px;
    margin: 20px 0;
}

/* Services Section */
.services {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 60px 40px;
    margin: 20px 0;
}

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

.service-card {
    background-color: var(--card-bg);
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.service-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--heading-color);
}

.service-card p {
    color: var(--muted-text);
    font-size: 1rem;
}

/* Contact Section */
.contact {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 60px 40px;
    margin: 20px 0;
    text-align: center;
}

.contact h2 {
    color: white;
}

.contact p {
    color: rgba(255, 255, 255, 0.9);
}

.contact .btn-primary {
    margin-top: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--muted-text);
    font-size: 0.9rem;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

/* Theme toggle switch */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Ensure native checkbox UI is hidden across browsers (Edge/Android fix) */
.theme-toggle-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}


.theme-toggle {
    position: static;
    width: 48px;
    height: 28px;
    padding: 3px;
    border-radius: 999px;
    display: inline-block;
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease;
    z-index: 10;
}

.theme-toggle .toggle-track { width: 100%; height: 100%; display: block; position: relative; border-radius: 999px; }
.theme-toggle .toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    transition: left 180ms cubic-bezier(.2,.8,.2,1), background 180ms ease, box-shadow 180ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--dark-color);
}

.theme-toggle[aria-checked="true"] {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.theme-toggle[aria-checked="true"] .toggle-thumb {
    left: calc(100% - 23px); /* 3px padding + 20px thumb */
}

/* sun/moon inside the thumb */
.theme-toggle .toggle-thumb::before {
    content: '☀';
}
.theme-toggle[aria-checked="true"] .toggle-thumb::before {
    content: '🌙';
}

@media (max-width: 768px) {
    /* keep toggle in header corner on small screens and align with logo top */
    .theme-toggle { position: absolute; right: 16px; top: 20px; }
}

/* Fade-in Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays */
header.fade-in {
    transition-delay: 0.2s;
}

.hero.fade-in {
    transition-delay: 0.4s;
}

.about.fade-in {
    transition-delay: 0.6s;
}

.services.fade-in {
    transition-delay: 0.8s;
}

.contact.fade-in {
    transition-delay: 1s;
}

footer.fade-in {
    transition-delay: 1.2s;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .nav-links {
        gap: 20px;
        font-size: 0.9rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }

    section h2 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .about,
    .services,
    .contact {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .hero {
        padding: 60px 15px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
