/* ============================================
   Andrew OBarr — Personal Site
   Single-page design with section toggling
   ============================================ */

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

:root {
    --color-bg: #DEDEDE;
    --color-text: #313131;
    --font-mono: 'Roboto Mono', monospace;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-mono);
    min-height: 100vh;
}

/* --- Landing / Main Layout --- */
.landing {
    padding: 40px 48px 48px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.name {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 64px;
    line-height: 131.7%;
    letter-spacing: 0.3em;
    color: var(--color-text);
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* --- Navigation --- */
.nav {
    display: flex;
    flex-direction: row;
    gap: 24px;
}

.nav-link {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 16px;
    line-height: 140%;
    color: var(--color-text);
    text-decoration: underline;
    text-transform: uppercase;
    padding: 10px 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    opacity: 0.6;
}

.nav-link:visited {
    color: var(--color-text);
}

.nav-link.active {
    font-weight: 500;
}

/* --- ASCII Blob Animation --- */
.waves {
    width: 100%;
    flex: 1;
    margin-top: 12px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.15;
    color: var(--color-text);
    opacity: 0.4;
    white-space: pre;
    user-select: none;
    cursor: pointer;
    transition: opacity 0.4s ease;
}

.waves.hidden {
    display: none;
}

/* --- Sections (hidden by default, shown on click) --- */
.section {
    display: none;
    width: 100%;
    max-width: 900px;
    margin-top: 48px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.section.visible {
    display: block;
}

.section.active {
    opacity: 1;
}

.section-content {
    width: 100%;
}

.section-title {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 32px;
    line-height: 140%;
    letter-spacing: 0.1em;
    color: var(--color-text);
    text-transform: uppercase;
    margin-bottom: 32px;
}

.section-body {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 16px;
    line-height: 180%;
    color: var(--color-text);
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
}

.section-body p {
    margin-bottom: 24px;
}

.section-body p:last-child {
    margin-bottom: 0;
}

.inquiries {
    margin-top: 32px;
    font-size: 14px;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.inquiries a {
    color: var(--color-text);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.inquiries a:hover {
    opacity: 0.6;
}

/* --- Essays List --- */
.essays-list {
    list-style: none;
    width: 100%;
    text-align: left;
}

.essay-item {
    border-bottom: 1px solid var(--color-text);
    padding: 24px 0;
}

.essay-item:first-child {
    border-top: 1px solid var(--color-text);
}

.essay-link {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 16px;
    line-height: 160%;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    transition: opacity 0.2s ease;
}

.essay-link:hover {
    opacity: 0.6;
}

.essay-title {
    font-weight: 500;
}

.essay-date {
    font-size: 14px;
    opacity: 0.6;
    white-space: nowrap;
}

/* --- Portfolio Grid (Symmetrical Tiles) --- */
.portfolio-note {
    font-size: 12px;
    letter-spacing: 0.05em;
    opacity: 0.55;
    margin-top: 4px;
    margin-bottom: 24px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
}

.portfolio-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--color-text);
    overflow: hidden;
    cursor: pointer;
}

.portfolio-tile--wide {
    grid-column: 1 / -1;
    aspect-ratio: 5 / 3;
}

.portfolio-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.portfolio-tile:hover img {
    opacity: 0.45;
}

.tile-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--color-text);
    background: rgba(222, 222, 222, 0.85);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.portfolio-tile:hover .tile-label {
    opacity: 1;
    transform: translateY(0);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.88);
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border: none;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .landing {
        padding: 32px 24px;
    }

    .name {
        font-size: 36px;
        letter-spacing: 0.2em;
    }

    .section-title {
        font-size: 24px;
    }

    .portfolio-grid {
        gap: 16px;
    }

    .essay-link {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .landing {
        padding: 24px 16px;
    }

    .name {
        font-size: 24px;
        letter-spacing: 0.15em;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .portfolio-tile--wide {
        grid-column: 1;
        aspect-ratio: 1 / 1;
    }
}
