/* ==========================================================================
   MEDIEVAL NET-ART / ESOTERIC WIKIPEDIA STYLESHEET
   The "Electric CRT Ledger" (Updated Hierarchy & Mobile Responsive)
   Palette:
   - Canvas / Paper:    #F8F2DC (Warm ivory)
   - Archival Ink:      #1A1A1A (Primary black)
   - Subtitle Slate:    #3D3D3D (Heavy charcoal graphite h2)
   - Accent / Titles:   #7B00CC (Electric CRT Purple)
   - Hyperlink Blue:    #0000FF (Sacred Web Blue)
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: clip; /* Prevents horizontal blowout without breaking position: sticky */
}

/* --- BASE GRID & CANVAS --- */
body {
    display: grid;
    grid-template-columns: 250px 1fr; 
    min-height: 100vh;
    margin: 0;
    
    background-color: #F8F2DC;
    color: #1A1A1A; 
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    
    position: relative;
}

/* Texture Overlay (Blended Specks Only) */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-image: url('images/texturetastic-gray.png');
    background-repeat: repeat;
    filter: contrast(130%) brightness(108%);
    mix-blend-mode: multiply;
    opacity: 0.6; 
    
    pointer-events: none;
    z-index: -1;
}

/* --- LEFT NAVIGATION SIDEBAR (DESKTOP) --- */
nav {
    background-image: url('images/leftbar-divider2.png');
    background-repeat: repeat-y;
    background-position: right -5px top; 
    background-size: 20px auto;
    image-rendering: pixelated;
    
    padding: 40px 60px 40px 30px;
    display: flex;
    flex-direction: column; 
    gap: 20px; 
}

.nav-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #1A1A1A;
    padding-bottom: 15px;
    width: 100%;
}

.nav-brand img {
    width: 100px;
    height: auto;
    display: block;
    filter: drop-shadow(1px 1px 0px rgba(123, 0, 204, 0.05));
}

nav a {
    color: #1A1A1A;
    text-decoration: none;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

nav a:hover {
    font-family: 'IM Fell English', serif; 
    font-style: italic;
    text-decoration: none;
    color: #7B00CC;
}

/* --- MAIN CONTENT AREA --- */
main {
    padding: 60px 80px;
    width: 100%;
    max-width: 1100px; /* Increase from 900px (e.g., 1100px, 1200px, or 1300px) */
    box-sizing: border-box;
}

/* --- TYPOGRAPHY & HEADINGS --- */

h1 {
    font-family: 'IM Fell English', serif;
    font-size: 4.5rem;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 1px;
    
    transform: scale(0.75, 1.3);
    transform-origin: left top;
    width: 130%;
    
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.5);
}

h2 {
    font-family: 'IM Fell English', serif;
    font-size: 2.2rem;
    font-style: italic;
    font-weight: normal;
    color: #3D3D3D;
    padding-bottom: 15px;
    margin-bottom: 40px;
    border-bottom: 1px solid #1A1A1A;
}

h3, .work-entry h3 {
    font-family: 'IM Fell English', serif;
    font-size: 1.8rem;
    font-style: italic;
    font-weight: normal;
    color: #7B00CC;
    margin: 0 0 10px 0;
}

p {
    font-size: 1.1rem;
    margin-bottom: 25px;
}

/* --- HYPERLINKS --- */
main a {
    color: #0000FF !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: bold;
}

main a:hover {
    background-color: #0000FF;
    color: #F8F2DC !important;
    text-decoration: none;
}

/* --- ARTIFACTS & DIVIDERS --- */

main > p:first-of-type::first-letter {
    font-family: 'IM Fell English', serif;
    font-size: 4.5rem;
    float: left;
    line-height: 0.8;
    margin-top: 5px;
    margin-right: 12px;
    color: #0000FF; 
    text-shadow: 3px 3px 0px #1A1A1A;
    -webkit-font-smoothing: none;
    font-smooth: never;
}

main blockquote {
    margin: 40px 0;
    padding: 15px 20px;
    border: 2px solid #1A1A1A; 
    box-shadow: 5px 5px 0px #7B00CC;
    font-family: "Helvetica Neue", Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    font-style: italic;
    background-color: transparent;
}

main hr {
    border: none;
    margin: 50px 0;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

main hr::before {
    content: "† ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ † ~ †";
    font-family: 'IM Fell English', serif;
    font-size: 1.2rem;
    letter-spacing: 8px;
    color: #1A1A1A;
    display: block;
    -webkit-font-smoothing: none; 
    font-smooth: never;
}

/* --- WORK / ARCHIVE LEDGER --- */

.filter-controls {
    margin-bottom: 40px;
    border-bottom: 2px solid #1A1A1A;
    padding-bottom: 15px;
}

.filter-btn {
    background: none;
    border: none;
    font-family: "Helvetica Neue", Helvetica, sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    color: #1A1A1A;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-right: 20px;
    padding: 0;
}

.filter-btn.active, 
.filter-btn:hover {
    color: #7B00CC;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.metadata {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #F8F2DC;
    background-color: #1A1A1A;
    padding: 4px 10px;
    display: inline-block;
    margin-bottom: 8px; 
}

.hidden {
    display: none;
}

/* --- ABOUT PAGE --- */

.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 20px;
}

.about-portrait {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portrait-frame {
    border: 2px solid #1A1A1A;
    box-shadow: 5px 5px 0px #7B00CC;
    background-color: #1A1A1A;
    line-height: 0;
}

.portrait-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text p {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.about-text p:first-of-type::first-letter {
    font-family: 'IM Fell English', serif;
    font-size: 3.8rem;
    float: left;
    line-height: 0.8;
    margin-top: 4px;
    margin-right: 10px;
    color: #7B00CC;
    text-shadow: 2px 2px 0px #1A1A1A;
    -webkit-font-smoothing: none;
    font-smooth: never;
}

.papyrus-text {
    font-family: 'Papyrus', fantasy, cursive;
    background-color: #7B00CC;
    color: #F8F2DC;
    padding: 1px 6px;
    margin: 0 2px;
    display: inline-block;
    line-height: 1.2;
    font-weight: normal;
    letter-spacing: 0.5px;
}

/* --- CONTACT PAGE --- */

.contact-block {
    margin-bottom: 30px;
}

.contact-email {
    font-size: 1.25rem;
    margin-top: 10px;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    word-break: break-all;
}

.contact-links {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}

.contact-links li {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* --- HOME LANDING PAGE --- */

/* --- HOME LANDING PAGE: INTERACTIVE QUOTE DOSSIER --- */

#quote-display {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 30px 0 40px 0;
}

.quote-text {
    font-family: 'Papyrus', fantasy, cursive;
    font-size: 1.35rem;
    line-height: 1.3;
    color: #1A1A1A;
    letter-spacing: 0.5px;
    font-style: normal;
}

.quote-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.quote-source {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.8rem;
    font-style: normal;
    font-weight: bold;
    color: #3D3D3D;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 1-Bit Ledger Arrow Controls */
.quote-controls {
    display: inline-flex;
    gap: 6px;
}

.quote-btn {
    background-color: transparent;
    border: 1px solid #1A1A1A;
    color: #1A1A1A;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1;
    padding: 3px 8px;
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(123, 0, 204, 0.35);
    user-select: none;
    transition: none;
}

.quote-btn:hover {
    background-color: #7B00CC;
    color: #F8F2DC;
    border-color: #7B00CC;
    box-shadow: none;
    transform: translate(1px, 1px);
}

.quote-btn:active {
    background-color: #1A1A1A;
    color: #F8F2DC;
    border-color: #1A1A1A;
}

.home-hero-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 35px;
    align-items: start;
}

.home-frame {
    border: 2px solid #1A1A1A;
    box-shadow: 5px 5px 0px #7B00CC;
    background-color: #1A1A1A;
    line-height: 0;
}

.home-frame img {
    width: 100%;
    height: auto;
    display: block;
    filter: contrast(110%);
}

.home-summary p {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* --- FOOTER --- */
.archive-footer {
    margin-top: 40px;
    padding-bottom: 40px;
    font-size: 0.95rem;
}

.archive-footer .copyright {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.8rem;
    color: #3D3D3D;
    margin-top: 10px;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 768px) {
    
    /* 1. Collapse Two-Column Shell */
    body {
        display: block;
        width: 100%;
    }

    /* 2. Sticky Horizontal Ledger Navigation */
    nav {
        position: -webkit-sticky;
        position: sticky;
        top: -95px; /* Exact height of the logo container: logo scrolls off, bar stays pinned */
        z-index: 999;
        
        background-color: #F8F2DC; /* Opaque ivory so scrolling text never shows through */
        background-image: none;
        
        width: 100%;
        margin: 0;
        padding: 0 20px; /* 20px matches the main text margins on both sides */
        
        display: flex;
        flex-direction: row; /* Overrides desktop column stack */
        flex-wrap: wrap;
        justify-content: space-between; /* Spreads HOME to the left margin, CONTACT to the right */
        align-items: center;
        gap: 0; /* Clears desktop vertical gap */
        
        border-bottom: 2px solid #1A1A1A;
    }

    /* Scrollable Logo Section */
    .nav-brand {
        width: 100%;
        height: 95px;
        margin: 0;
        padding: 15px 0;
        border-bottom: 1px solid #1A1A1A;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }

    .nav-brand img {
        width: 65px;
        height: auto;
    }

    /* Justified Horizontal Link Row */
    nav a {
        display: inline-flex;
        align-items: center;
        padding: 16px 0; /* Comfortable thumb target */
        margin: 0;
        
        font-size: 0.9rem;
        font-weight: bold;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: #1A1A1A;
        white-space: nowrap;
    }

    nav a:hover,
    nav a:active {
        color: #7B00CC;
        background: none;
        font-family: inherit;
        font-style: normal;
    }

    nav a:hover::after {
        content: none;
    }

    /* 3. Main Content Alignment (20px Matches Nav Padding) */
    main {
        padding: 30px 20px 60px 20px;
        width: 100%;
        max-width: 100%;
    }

    h1 {
        font-size: 2.2rem;
        width: 100%;
        transform: none;
        line-height: 1.15;
        margin-bottom: 8px;
        word-wrap: break-word;
    }

    h2 {
        font-size: 1.25rem;
        line-height: 1.35;
        padding-bottom: 12px;
        margin-bottom: 25px;
        word-wrap: break-word;
    }

    p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* 4. Containers & Artifacts */
    main blockquote {
        margin: 25px 0 30px 0;
        padding: 14px 16px;
        width: calc(100% - 5px);
    }

    .quote-text {
        font-size: 1.15rem;
    }

    .home-hero-grid,
    .about-grid {
        display: flex;
        flex-direction: column;
        gap: 25px;
        width: 100%;
    }

    .home-frame,
    .portrait-frame {
        width: calc(100% - 5px);
        max-width: 100%;
    }

    .home-frame img,
    .portrait-frame img {
        width: 100%;
        height: auto;
    }

    /* 5. Ledger Filter Buttons */
    .filter-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 14px;
        margin-bottom: 25px;
        padding-bottom: 12px;
    }

    .filter-btn {
        margin-right: 0;
        font-size: 0.85rem;
    }

    main hr {
        margin: 35px 0;
    }
}