/* ===== CSS Variables ===== */
:root {
    --primary-color: #8B7355;
    --secondary-color: #D4A574;
    --accent-color: #6B8E23;
    --text-dark: #2C2C2C;
    --text-light: #5C5C5C;
    --bg-light: #F9F7F4;
    --bg-alt: #F0EBE4;
    --white: #FFFFFF;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

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

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero .subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    opacity: 0.95;
}

/* ===== Navigation ===== */
.nav {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.nav-link {
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link:focus {
    background-color: var(--bg-alt);
    color: var(--accent-color);
}

/* ===== Main Content ===== */
main {
    min-height: 60vh;
}

.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.alt-bg {
    background-color: var(--bg-alt);
}

/* ===== Cards ===== */
.card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.card p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ===== Stats Grid ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--bg-alt);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Facts Grid ===== */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.fact-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--accent-color);
}

.fact-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.fact-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.fact-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.fact-card p {
    color: var(--text-light);
}

/* ===== Gallery ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.gallery-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item figcaption {
    padding: 1rem;
    text-align: center;
    color: var(--text-dark);
    font-weight: 500;
}

/* ===== Personality Traits ===== */
.personality-traits {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.trait {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent-color);
    transition: var(--transition);
}

.trait:hover {
    border-left-width: 8px;
    box-shadow: var(--shadow-lg);
}

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

.trait p {
    color: var(--text-light);
}

/* ===== Quote Box ===== */
.quote-box {
    background: linear-gradient(135deg, var(--accent-color) 0%, #8FBC8F 100%);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

.quote-box blockquote {
    font-size: 1.5rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.quote-box footer {
    font-size: 1rem;
    opacity: 0.9;
}

/* ===== CTA Card ===== */
.cta-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

.cta-card h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.cta-card p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* ===== Form ===== */
.signup-form {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 500px;
    margin: 0 auto;
}

.signup-form input {
    flex: 1;
    min-width: 250px;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    outline: none;
}

.signup-form input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.btn {
    padding: 1rem 2rem;
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn:hover {
    background-color: #556B2F;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
}

.form-message {
    margin-top: 1rem;
    font-weight: 600;
    min-height: 1.5rem;
}

.form-message.success {
    color: #90EE90;
}

.form-message.error {
    color: #FFB6C1;
}

/* ===== Footer ===== */
.footer {
    background-color: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ===== Scroll to Top Button ===== */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background-color: var(--accent-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 99;
}

.scroll-top:hover {
    background-color: #556B2F;
    transform: translateY(-3px);
}

.scroll-top.visible {
    display: flex;
}

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

.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-delay {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .section {
        padding: 3rem 0;
    }

    .nav-list {
        gap: 1rem;
    }

    .stat-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }

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

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .signup-form {
        flex-direction: column;
    }

    .signup-form input {
        min-width: 100%;
    }

    .quote-box blockquote {
        font-size: 1.2rem;
    }

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

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .card,
    .fact-card,
    .trait {
        padding: 1.5rem;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Image Modal ===== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease-out;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease-out;
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    display: block;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#modal-caption {
    margin-top: 1rem;
    color: var(--white);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* ===== Modal Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== Print Styles ===== */
@media print {
    .nav,
    .scroll-top,
    .signup-form,
    .image-modal {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
    }
}
