@import url('https://fonts.googleapis.com/css2?family=Inter:wght@900&family=Space+Mono:wght@400;700&display=swap');

/* 1. VARIABLES & RESET */
:root {
    --paper: #F4F1EA; 
    --ink: #1A1A1B;
    --accent: #A52A2A; 
    
    /* Responsive Variables */
    --line-w: 5px;
    --line: var(--line-w) solid var(--ink);
    --pattern-w: 60px;
    --shadow-off: 10px;
    
    /* Typography */
    --header-fs: clamp(3rem, 12vw, 9rem);
    --ticker-fs: clamp(2.5rem, 10vw, 7.5rem);
}

* {
    box-sizing: border-box; /* Essential for grid and shadows */
}

/* 2. LAYOUT ENGINE */
body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: "Palatino", "Palatino Linotype", serif;
    margin: 0;
    display: grid;
    grid-template-columns: var(--pattern-w) 1fr var(--pattern-w);
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal "jiggle" on mobile */
}

main {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 3. SIDEBARS */
.sidebar-pattern {
    background-color: var(--ink); 
    background-image: url("data:image/svg+xml,%3Csvg width='61' height='41' viewBox='0 0 61 41' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cfilter id='smooth'%3E%3CfeGaussianBlur stdDeviation='0.5' /%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23smooth)'%3E%3Ccircle cx='20' cy='12' r='4' fill='%23D1CEC7' opacity='0.2'/%3E%3Ccircle cx='50' cy='12' r='4' fill='%23D1CEC7' opacity='0.2'/%3E%3Ccircle cx='35' cy='32' r='4' fill='%23D1CEC7' opacity='0.2'/%3E%3Ccircle cx='5' cy='32' r='4' fill='%23D1CEC7' opacity='0.2'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 61px 41px;
    background-position: center;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}

.sidebar-left { border-right: var(--line); }
.sidebar-right { border-left: var(--line); }

/* 4. HEADER & TICKER */
header {
    padding: 4rem 2rem 2rem 2rem;
    border-bottom: var(--line);
}

.title-static {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: var(--header-fs);
    line-height: 0.8;
    letter-spacing: -0.06em;
    text-transform: uppercase;
}

.ticker-container {
    font-size: var(--ticker-fs);
    height: 1.15em;
    overflow: hidden;
    margin-top: 0.5rem;
}

.ticker-move {
    display: flex;
    flex-direction: column;
    animation: ticker-slide 20s cubic-bezier(0.85, 0, 0.15, 1) infinite;
}

.ticker-move div {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    height: 1.15em;
    line-height: 1.15em;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    color: var(--accent);
    white-space: nowrap;
}

@keyframes ticker-slide {
    0%, 14% { transform: translateY(0%); }
    16%, 30% { transform: translateY(-16.66%); }
    32%, 46% { transform: translateY(-33.33%); }
    48%, 62% { transform: translateY(-50%); }
    64%, 78% { transform: translateY(-66.66%); }
    80%, 94% { transform: translateY(-83.33%); }
    100% { transform: translateY(0%); }
}

/* 5. NAVIGATION */
nav {
    display: flex;
    border-bottom: var(--line);
    background: var(--ink);
    color: var(--paper);
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    font-weight: bold;
}

.nav-item {
    flex: 1; 
    padding: 0.8rem 0.5rem;
    border-right: 1px solid rgba(244, 241, 234, 0.2);
    text-decoration: none;
    color: inherit;
    font-size: 1.1rem;
    text-align: center;
    transition: background 0.2s;
}

.nav-item:last-child { border-right: none; }
.nav-item:hover { background: var(--accent); color: white; }

/* 6. CONTENT & GALLERY */
.content-area {
    padding: 4rem 2rem;
    /* This padding-right ensures the 10px shadow never clips */
    padding-right: calc(2rem + var(--shadow-off)); 
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: 2rem;
    letter-spacing: -2px;
}

.content-area h3 {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase; /* Keeps the 'system log' aesthetic for sections */
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Optional: Add a small accent square before the h3 to mimic your gallery style */
.content-area h3::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent);
}

.gallery-grid {
    display: grid;
    /* minmax(0, 1fr) prevents long URLs from pushing the grid wider than the screen */
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    column-gap: 3rem;
    row-gap: 2rem; 
    align-items: start; 
}

figure {
    width: 100%;
    margin: 0 0 2rem 0;
    border: var(--line);
    background: white;
    box-shadow: var(--shadow-off) var(--shadow-off) 0px var(--accent); 
}

figure img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

figcaption {
    padding: 0.8rem 1rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    border-top: var(--line);
    background: var(--ink);
    color: var(--paper);
    word-break: break-word; /* Prevents text overflow */
}

.fig-unit {
    max-width: 100%;
    margin-top: 0rem;
    margin-bottom: 0rem;
    margin-left: auto;  /* Added for centering */
    margin-right: auto; /* Added for centering */
}

.w-50 { width: 50%; }

.fig-unit figcaption {
    width: 100%;
}

.caption-link {
    display: block;
    margin-top: 0.6rem;
    color: #888888;
    text-decoration: none;
    font-size: 0.7rem;
}

/* 7. LIGHTBOX */
.lightbox {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(26, 26, 27, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90vw; 
    max-height: 75vh;
    object-fit: contain;
    border: 2px solid var(--paper);
}

#lightbox-caption {
    width: 90vw;
    max-width: 800px;
    margin-top: 20px;
    text-align: center;
    color: var(--paper);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
}

.close-lightbox {
    position: absolute;
    top: 20px; right: 30px;
    color: var(--paper);
    font-size: 40px;
    cursor: pointer;
}

/* 8. FOOTER */
footer {
    padding: 3rem 2rem;
    border-top: var(--line);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-align: center;
}

footer::after {
    content: "The adherence to a Bauhaus grid allows for a structured interpretation of biological chaos [50.8317° N, 5.7149° E].";
}

/* 9. RESPONSIVE MEDIA QUERIES */

/* TABLETS & MEDIUM SCREENS */
@media (max-width: 1024px) {
    :root {
        --pattern-w: 40px;
        --shadow-off: 8px;
    }
    .gallery-grid { column-gap: 2rem; }
}

/* SMALL TABLETS / LARGE PHONES */
@media (max-width: 768px) {
    :root {
        --pattern-w: 0px; /* Hide sidebars to save space */
        --line-w: 3px;
        --shadow-off: 6px;
    }
    
    body { grid-template-columns: 1fr; }
    .sidebar-pattern { display: none; }
    
    header { padding: 2rem 1rem; }
    .content-area { padding: 2rem 1rem; padding-right: calc(1rem + var(--shadow-off)); }

    .fig-unit.w-50 {
        width: 75%; /* Expands to full width on mobile */
    }
}

/* SMARTPHONES */
@media (max-width: 600px) {
    nav { flex-direction: column; }
    .nav-item { 
        border-right: none; 
        border-bottom: 1px solid rgba(244, 241, 234, 0.1); 
        text-align: left;
        padding: 1rem;
    }
    
    .gallery-grid { grid-template-columns: 1fr; }
    
    .title-static { font-size: 16vw; }
    
    .lightbox-content { max-height: 60vh; }

    .fig-unit.w-50 {
        width: 100%; /* Expands to full width on mobile */
    }
}

/* Styling for the personal website link */
/* Subtle Archival Link */
.author-link {
    font-family: inherit; /* Inherits the body font (Inter/serif) instead of Mono */
    color: var(--accent);       /* Matches the text color */
    text-decoration: none;
    transition: all 0.2s ease;
}

.author-link:hover {
    color: var(--accent);
    background: rgba(165, 42, 42, 0.03);    /* Very faint highlight */
}
