/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: 'Crimson Pro', Georgia, serif;
    background-color: #0a0a0a;
    color: #2a2a2a;
    line-height: 1.6;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Portrait container with black sides */
.content-container {
    position: relative;
    width: 60vw;
    max-width: 600px;
    height: 95vh;
    background-color: #f5f4ed;
    border: 1px solid #2a2a2a;
    overflow: hidden;
}

/* About page (always in background) */
.about-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2rem 2rem 6rem 2rem;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
    overflow-y: auto;
    transition: opacity 0.3s ease;
}

.about-page.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 3;
    cursor: pointer;
}

/* Dim about page further when viewing poems */
.about-page.dimmed {
    opacity: 0.1;
}

.about-content {
    max-width: 100%;
    font-size: 1.25rem;
    line-height: 1.4;
    padding-bottom: 4rem;
    padding-top: calc(1.25rem * 1.4 * 5);
}

.about-content p {
    margin-bottom: 1.5rem;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.5rem;
}

/* Sphinx divider with horizontal rules */
.sphinx-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    gap: 1.5rem;
}

.sphinx-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid #2a2a2a;
    opacity: 0.3;
}

.sphinx-glyph {
    width: 30px;
    height: auto;
    opacity: 0.9;
    flex-shrink: 0;
}

/* Literature-style indents for some paragraphs */
.about-content p.indent {
    text-indent: 2em;
}

/* Tractatus formatting */
.tractatus {
    margin-top: 2rem;
}

.tractatus-entry {
    display: flex;
    margin-bottom: 1rem;
    align-items: baseline;
}

.tractatus-number {
    flex-shrink: 0;
    width: 5rem;
    font-family: 'Averia Sans Libre', sans-serif;
    font-size: 1.25rem;
    text-align: left;
    position: relative;
    top: 0.05em;
}

.tractatus-text {
    flex: 1;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.4;
}

.tractatus-citation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #2a2a2a;
    opacity: 0.6;
}

.tractatus-citation p {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.site-copyright {
    margin-top: 2rem;
    margin-bottom: 3rem;
    opacity: 0.6;
}

.site-copyright p {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* Special spacing for centered sections */
.about-content p.centered-spacing {
    text-align: left;
    position: relative;
}

.about-content p.centered-spacing .spacing {
    display: inline-block;
    width: 8em;
}

/* Bio page */
.bio-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    overflow-y: auto;
    z-index: 3;
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.bio-page.active {
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.bio-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('photo.jpg');
    background-size: 200% auto;
    background-position: top left;
    background-repeat: no-repeat;
    z-index: 1;
    display: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.bio-page.active .bio-background {
    display: block;
}

.bio-about-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f4ed;
    opacity: 0.75;
    z-index: 2;
    pointer-events: none;
    display: none;
}

.bio-page.active .bio-about-layer {
    display: block;
}

.bio-content {
    max-width: 100%;
    position: relative;
    z-index: 3;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 4rem;
    padding-top: calc(2rem + (1.25rem * 1.4 * 5));
    display: none;
}

.bio-page.active .bio-content {
    display: block;
}

.bio-photo {
    display: none;
}

.bio-content p {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 2rem;
    color: #2a2a2a;
}

.instagram-link {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.5rem;
    color: #2a2a2a;
    text-decoration: none;
    display: inline-block;
}

.instagram-link:hover {
    opacity: 0.7;
}

/* Menu overlay (home page) */
.menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: none;
    pointer-events: none;
}

.menu.active {
    display: block;
    pointer-events: auto;
}

.menu-glyph {
    position: absolute;
    opacity: 0.4;
    pointer-events: none;
    z-index: 150;
}

.menu-glyph path {
    fill: #2a2a2a;
}

.menu-glyph.top-left {
    top: 2rem;
    left: 2rem;
}

.menu-glyph.bottom-right {
    bottom: 2rem;
    right: 2rem;
}

/* Name header - top left */
.name-header {
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: auto;
    font-size: 3.5rem;
    font-weight: normal;
    font-family: 'Averia Sans Libre', sans-serif;
    color: #2a2a2a;
    z-index: 10;
    cursor: pointer;
    transition: opacity 0.3s ease;
    line-height: 1.2;
    text-align: left;
}

.name-header:hover {
    opacity: 0.7;
}

/* Menu navigation - bottom right */
.menu-nav {
    position: absolute;
    left: auto;
    right: 2rem;
    top: auto;
    bottom: calc(2rem - 0.2rem);
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 10;
    align-items: flex-end;
}

.menu-link {
    font-size: 3.5rem;
    font-family: 'Crimson Pro', Georgia, serif;
    color: #2a2a2a;
    text-decoration: none;
    font-weight: normal;
    transition: opacity 0.3s ease;
    cursor: pointer;
    line-height: 1.2;
    display: block;
    text-align: right;
}

.menu-link:hover {
    opacity: 0.7;
}

/* Poems page */
.poems-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    padding: 4rem 2rem;
    overflow-y: auto;
    z-index: 3;
    cursor: pointer;
}

.poems-page.active {
    display: block;
}

.poems-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    min-height: 100%;
    padding-bottom: 10rem;
}

.poems-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.poems-list li {
    font-size: 2.5rem;
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: normal;
    line-height: 0.95;
    margin-bottom: 1.5rem;
}

.poems-list li a {
    color: #2a2a2a;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.poems-list li a:hover {
    opacity: 0.7;
}

.poems-list sup {
    font-size: 1.25rem;
    vertical-align: super;
}

/* Footnotes - bottom right */
.footnotes {
    position: absolute;
    bottom: 3rem;
    right: 4rem;
    text-align: right;
    font-size: 1.25rem;
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: normal;
    line-height: 1.4;
    max-width: 350px;
}

.footnote {
    margin-bottom: 0.5rem;
}

/* Responsive design */
@media (max-width: 1024px) {
    .content-container {
        width: 95vw;
        height: 90vh;
    }

    .about-content {
        max-width: 90%;
    }

    .name-header {
        right: 2rem;
        top: 2rem;
        font-size: 1.25rem;
    }

    .menu-nav {
        left: 2rem;
    }

    .menu-link {
        font-size: 2rem;
    }

    .poems-page {
        padding: 3rem 2rem;
    }

    .footnotes {
        right: 2rem;
        bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .content-container {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border: none;
    }

    .about-page {
        padding: 2rem 2rem 6rem 2rem;
    }

    .about-content {
        max-width: 100%;
        font-size: 1rem;
        padding-top: calc(1rem * 1.4 * 5);
    }

    .about-content p {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .name-header {
        left: 2rem;
        right: auto;
        top: 2rem;
        font-size: 3.5rem;
        line-height: 1.2;
        text-align: left;
    }

    .menu-nav {
        left: auto;
        right: 2rem;
        top: auto;
        bottom: calc(2rem - 0.2rem);
        transform: none;
        align-items: flex-end;
    }

    .menu-link {
        font-size: 3.5rem;
        line-height: 1.2;
        text-align: right;
    }

    .menu-glyph.top-left {
        top: 2rem;
        left: 2rem;
    }

    .menu-glyph.bottom-right {
        bottom: 2rem;
        right: 2rem;
    }

    .bio-content {
        padding-left: 2rem;
        padding-right: 2rem;
        padding-bottom: 3rem;
        padding-top: calc(2rem + (1rem * 1.4 * 5));
    }

    .bio-content p {
        font-size: 1.2rem;
        color: #2a2a2a;
    }

    .instagram-link {
        font-size: 1.2rem;
        color: #2a2a2a;
    }

    .poems-page {
        padding: 3rem 2rem;
    }

    .poems-list li {
        font-size: 2.5rem;
        line-height: 0.95;
    }
    
    .poems-list sup {
        font-size: 1.25rem;
    }

    .footnotes {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: 3rem;
        max-width: 100%;
        text-align: left;
        font-size: 1rem;
        line-height: 1.4;
    }

    .poems-content {
        padding-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .about-page {
        padding: 1.5rem 1.5rem 6rem 1.5rem;
    }

    .about-content {
        max-width: 100%;
        font-size: 1rem;
        padding-top: calc(1rem * 1.4 * 5);
    }

    .about-content p {
        font-size: 1.2rem;
        line-height: 1.4;
    }
    
    .about-content p.centered-spacing .spacing {
        width: 4em;
    }

    .name-header {
        left: 1.5rem;
        right: auto;
        top: 2.5rem;
        font-size: 3.5rem;
        line-height: 1.2;
        text-align: left;
    }

    .menu-nav {
        left: auto;
        right: 1.5rem;
        top: auto;
        bottom: calc(2.5rem - 0.2rem);
        transform: none;
        align-items: flex-end;
    }

    .menu-link {
        font-size: 3.5rem;
        line-height: 1.2;
        text-align: right;
    }

    .menu-glyph.top-left {
        top: 2.5rem;
        left: 1.5rem;
    }

    .menu-glyph.bottom-right {
        bottom: 2.5rem;
        right: 1.5rem;
    }

    .bio-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        padding-bottom: 3rem;
        padding-top: calc(1.5rem + (1rem * 1.4 * 5));
    }

    .bio-content p {
        font-size: 1.2rem;
        color: #2a2a2a;
    }

    .instagram-link {
        font-size: 1.2rem;
        color: #2a2a2a;
    }

    .poems-page {
        padding: 3rem 1.5rem;
    }

    .poems-list li {
        font-size: 2.5rem;
        line-height: 0.95;
    }
    
    .poems-list sup {
        font-size: 1.25rem;
    }
}
