/* --- RESET & VARIABLES --- */
:root {
    --bg-color: #ffffff;
    --sidebar-bg: #f8f9fa;
    --text-main: #1f2937;  /* Darker, higher contrast */
    --text-muted: #6b7280;
    --accent: #2563eb;     /* Modern Royal Blue */
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Merriweather', serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden; /* Critical for mobile */
    -webkit-font-smoothing: antialiased;
}

/* --- IMAGES & MEDIA --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- MOBILE LAYOUT (DEFAULT) --- */
.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- SIDEBAR (MOBILE HEADER) --- */
.sidebar {
    width: 100%;
    background-color: var(--bg-color); /* White on mobile for clean look */
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

.sidebar-inner {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
}

.sidebar h1 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1rem;
}

.contact-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Mobile Nav */
.main-nav {
    margin-top: 1.5rem;
    display: flex;
    gap: clamp(0.5rem, 2vw, 1.5rem);
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

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

/* --- CONTENT --- */
.content {
    width: 100%;
    padding: 3rem 1.5rem;
}

section {
    margin-bottom: 5rem;
    scroll-margin-top: 80px; /* Space for sticky headers if any */
}

h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent);
    margin-top: 8px;
    border-radius: 2px;
}

p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
    color: #4b5563;
    max-width: 65ch; /* Optimal reading length */
}

p.lead {
    font-size: 1.15rem;
    color: var(--text-main);
}

.section-subtitle {
    margin-top: -1rem;
    margin-bottom: 2rem;
    font-style: italic;
    color: var(--text-muted);
}

/* --- GRIDS (Photos & Art) --- */
.photo-grid, .gallery {
    display: grid;
    /* Responsive auto-fit grid without media queries */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card, .gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

.card:hover, .gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.card img, .gallery-item img {
    width: 100%;
    /* Aspect ratio hack for consistent heights even if images vary */
    aspect-ratio: 4 / 3; 
    object-fit: cover;
    display: block;
}

.caption {
    padding: 1rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}



/* --- CONTACT REVEAL ANIMATION --- */
.email-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.contact-reveal {
    min-width: 180px; /* Prevents layout jump when text changes */
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent; /* Prepare for border transition */
}

/* The 'Revealed' State */
.contact-reveal.revealed {
    background-color: transparent;
    color: var(--accent);
    border-color: var(--accent);
    cursor: copy; /* Shows the user they can copy it */
}

.copy-feedback {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    height: 1.5rem; /* Reserve space */
}

.copy-feedback.visible {
    opacity: 1;
    transform: translateY(0);
    color: #10b981; /* A nice success green */
}

/* --- BUTTONS --- */
.button {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 0.875rem 2rem;
    text-decoration: none;
    border-radius: 50px; /* Pill shape */
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: var(--shadow-sm);
}

.button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* --- FOOTER --- */
footer {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
}

#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-main);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    z-index: 500;
    pointer-events: none; /* disabled when hidden */
}

#backToTop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- DESKTOP UPGRADES (Media Queries) --- */
@media (min-width: 1024px) {
    .layout {
        flex-direction: row;
    }

    /* Sticky Sidebar Layout */
    .sidebar {
        width: 340px;
        height: auto;
        min-height: 100vh;
        border-bottom: none;
        border-right: 1px solid var(--border);
        background-color: var(--sidebar-bg);
        /* Make sidebar stick to top */
        position: sticky;
        top: 0;
        align-self: flex-start;
        max-height: 100vh;
        overflow-y: auto;
    }

    .sidebar-inner {
        padding: 4rem 2rem;
        text-align: left;
        align-items: flex-start;
        height: 100%;
        justify-content: center;
    }

    .avatar {
        width: 140px;
        height: 140px;
        margin-bottom: 1.5rem;
    }

    .main-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-top: 3rem;
    }

    .nav-link {
        font-size: 1.1rem;
    }

    .content {
        /* Take remaining width */
        flex: 1; 
        padding: 5rem 4rem;
        max-width: 1400px;
    }

    h2 {
        font-size: 2.2rem;
    }
}
