/* --- CSS VARIABLES & RESET --- */
:root {
    /* Minimalist Palette */
    --bg-color: #fcfbf9;     /* Warm Off-White */
    --card-bg: #ffffff;      /* Pure White for contrast */
    --text-main: #1a1a1a;    /* Soft Black */
    --text-muted: #666666;   /* Grey */
    --border-color: #e6e6e6;
    
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

/* --- HEADER (Persistent & Minimal) --- */
header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 1.5rem 5%;
    /* Z-INDEX INCREASED to stay above Reader Overlay */
    z-index: 2500; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(252, 251, 249, 0.95); 
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, padding 0.3s ease;
}

header.scrolled {
    border-bottom: 1px solid var(--border-color);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.brand {
    cursor: pointer;
    z-index: 1002;
    position: relative;
}

.brand h1 {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 3.5rem; 
    letter-spacing: -0.02em;
    line-height: 0.9;
}

/* --- HAMBURGER MENU --- */
.hamburger {
    display: none; 
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    z-index: 1002; 
    padding: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
}

/* Hamburger Active State */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- NAVIGATION --- */
.main-nav {
    display: flex;
    gap: 2rem;
    transition: all 0.4s ease;
}

.nav-link {
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s;
    white-space: nowrap; 
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    height: 1px;
    background: var(--text-main);
}

/* --- SECTIONS & VIEWS --- */
.view-section {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    min-height: 100vh;
    padding-top: 8rem; 
}

.view-section.active {
    display: block;
    opacity: 1;
}

/* --- NEW HOME LAYOUT (Split) --- */
#view-home.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 5%;
    align-items: center; 
    min-height: 70vh;
}

.home-bio {
    font-family: var(--font-serif);
    color: var(--text-main);
}

.home-bio p {
    font-size: 1.15rem; 
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.home-bio p a {
    color: var(--text-main);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.home-bio p a:hover {
    color: var(--text-muted);
}

.home-bio .lead-text {
    font-size: 1.5rem;
    line-height: 1.4;
    font-weight: 400;
}

.home-image {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Added negative margin to move image up */
    margin-top: -75px;
}

.home-image img {
    width: 70%; /* Scaled down to 70% per request */
    height: auto;
    object-fit: cover;
    max-height: 700px; 
}


/* --- VIEW: WRITINGS (ARCHIVE) --- */
.archive-header {
    text-align: center;
    margin-bottom: 4rem;
    margin-top: 2rem;
}
.archive-header h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
}

.feed-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 5% 5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.feed-container.single-column {
    max-width: 900px;
    gap: 5rem;
}

.article-card {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    transition: opacity 0.3s;
}

.article-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* Link styling for article titles */
.article-title a {
    text-decoration: none;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.article-title a:hover {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.external-icon {
    width: 1.2rem;
    height: 1.2rem;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.article-title a:hover .external-icon {
    opacity: 1;
}

/* --- VIDEO THUMBNAILS & PLAY BUTTON --- */
.video-card {
    border-bottom: none; 
    cursor: default; 
}

.video-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.video-wrapper:hover .video-thumb {
    transform: scale(1.02);
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.play-btn svg {
    fill: white;
    width: 24px;
    height: 24px;
    margin-left: 4px; 
}

.video-wrapper:hover .play-btn {
    background: #ff0000; 
    transform: translate(-50%, -50%) scale(1.1);
}

/* --- VIEW: RESUME --- */
.resume-container {
    width: 70%; /* Reduced width to 70% */
    max-width: 1600px; /* Allow much wider */
    margin: 0 auto;
    padding: 1rem 3%;
    height: calc(100vh - 100px); /* Fill most of the viewport */
    display: flex;
    flex-direction: column;
}

.resume-container h2 {
    font-family: var(--font-serif);
    font-size: 4rem; /* Larger Resume Title */
}

.pdf-container {
    flex: 1; /* Fill remaining vertical space */
    width: 100%;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: block;
}

.pdf-container iframe,
.pdf-container object,
.pdf-container embed {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- VIEW: CONTACT FORM --- */
.contact-container {
    max-width: 600px; 
    margin: 0 auto;
    padding: 4rem 5%;
}
.contact-container h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 2px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text-main);
}

.submit-btn {
    align-self: flex-start;
    padding: 12px 30px;
    background-color: var(--text-main);
    color: white;
    border: none;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    border-radius: 2px;
}

.submit-btn:hover {
    background-color: #333;
}
.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contact-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.5rem;
}
.contact-status.success { color: green; }
.contact-status.error { color: red; }


/* Utilities */
.hidden { display: none; }
.end-mark {
    text-align: center; padding: 4rem; background: var(--bg-color);
    position: relative; z-index: 10;
}
.nav-link-inline {
    background: none; border: none; font-family: var(--font-serif);
    font-style: italic; font-size: 1.2rem; cursor: pointer;
    margin-top: 1rem; border-bottom: 1px solid black;
}

/* --- ARCHIVE FILTER UI --- */

#filter-ui-container {
    margin-top: 3rem; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem; 
}

/* Logo Grid Container */
#outlet-filters.logo-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem; 
    max-width: 1100px;
    padding: 0 1rem;
}

/* Filter Logos */
.filter-logo {
    height: 35px; 
    width: auto;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 6px;
    border: 2px solid transparent; 
    padding: 2px;
    filter: none;
    opacity: 0.7; 
    margin-bottom: 0.5rem;
}

.filter-logo:hover {
    opacity: 1;
    border-color: #e5e7eb; 
    background-color: white;
}

.filter-logo.active {
    opacity: 1;
    transform: scale(1.3); 
    border-color: var(--text-main); 
    background-color: white;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
}

/* View All Button */
.filter-reset-btn {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
    white-space: nowrap;
    margin-bottom: 0.5rem;
    height: auto;
}

.filter-reset-btn:hover,
.filter-reset-btn.active {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.search-sort-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
    max-width: 600px;
}

.inline-search-container {
    position: relative;
    display: flex;
    align-items: center;
}
.inline-search-container svg {
    position: absolute;
    left: 0;
    color: #999;
    width: 16px;
    height: 16px;
    pointer-events: none;
}
.inline-search-container input {
    padding-left: 24px; 
    padding-right: 8px;
    padding-bottom: 4px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    width: 180px;
    color: var(--text-main);
}
.inline-search-container input:focus {
    outline: none;
    border-bottom-color: var(--text-main);
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sort-container select {
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    font-weight: 500;
}
.sort-container select:focus {
    outline: none;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    header {
        flex-direction: row;
        align-items: center;
        padding: 1rem 1.5rem;
    }

    .brand h1 { font-size: 2.2rem; }

    .hamburger { display: flex; }

    .main-nav {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100vh;
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1001; 
        opacity: 0; pointer-events: none;
        transform: translateY(-20px);
    }

    .main-nav.active {
        opacity: 1; pointer-events: auto;
        transform: translateY(0);
    }

    .nav-link { font-size: 2rem; margin-bottom: 1rem; color: var(--text-main); }
    .nav-link.active::after { display: none; }
    .nav-link[data-target="home"] { display: none; }

    .view-section { padding-top: 6rem; }

    .home-split-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 5%;
        text-align: left;
    }
    
    .home-bio .lead-text { font-size: 1.5rem; }
    .home-bio p { font-size: 1rem; }

    .home-image {
        max-height: 50vh;
        order: 1; 
        /* Reset negative margin on mobile if needed, or adjust */
        margin-top: 1rem;
    }

    #filter-ui-container { gap: 2rem; }
    #outlet-filters.logo-filters { gap: 0.5rem; }
    .filter-logo { height: 32px; }
    .filter-logo.active { transform: scale(1.15); }
    .filter-separator { margin: 0 0.5rem; }

    .search-sort-row { flex-direction: column; gap: 1.5rem; }
    .inline-search-container input { width: 100%; font-size: 1rem; }
    
    .pdf-container { height: 60vh; min-height: 400px; }
    .contact-container { padding: 2rem 5%; }
}