/* ========== TOKENS ========== */
:root {
    --ink: #ece6da;
    --muted: #a89e8e;
    --paper: #171512;
    --hairline: rgba(255, 255, 255, 0.12);
    --brass: #c99b64;
    --charcoal: #1e1c1a;

    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", Arial, sans-serif;

    --sidebar-width: 36vw;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    position: relative;
}

/* Same photo as the sidebar, blurred and darkened, fixed behind the
   entire page so the content pane reads as a continuation of the
   sidebar rather than a bright wall butted up against it. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("images/background.jpg") center / cover no-repeat;
    filter: blur(50px) brightness(0.3) saturate(1.1);
    z-index: -1;
}

img {
    max-width: 100%;
    display: block;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    padding: 60px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;

    background:
        linear-gradient(180deg, rgba(20, 18, 16, 0.55) 0%, rgba(20, 18, 16, 0.82) 75%),
        url("images/background.jpg") center / cover no-repeat;
}

.sidebar-top .avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.7);
    margin-bottom: 28px;
}

.sidebar-top h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2.2rem;
    line-height: 1.15;
    margin: 0 0 12px;
}

.sidebar-top .tagline {
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
    max-width: 30ch;
    margin: 0;
}

.sidebar-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* ========== MAIN CONTENT ========== */
.content {
    margin-left: var(--sidebar-width);
    padding: 90px 8vw 60px;
    max-width: 900px;
}

.intro h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 2.4rem;
    line-height: 1.25;
    max-width: 18ch;
    margin: 0 0 24px;
    color: var(--ink);
}

.intro p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--muted);
    max-width: 62ch;
    margin: 0 0 40px;
}

.hero-image {
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
}

/* ========== FRIENDS ========== */
.friends {
    margin-top: 90px;
    padding-top: 50px;
    border-top: 1px solid var(--hairline);
}

.friends h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.6rem;
    margin: 0 0 40px;
    color: var(--ink);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 36px;
    row-gap: 48px;
}

figure {
    margin: 0;
}

.frame {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 3px;
    overflow: hidden;
    isolation: isolate;
}

/* A soft dark scrim behind any letterboxed space, so odd-shaped
   photos sit on something quiet rather than the busy page backdrop
   showing straight through. */
.frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(8, 7, 6, 0.4);
    z-index: 0;
}

.frame img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    filter: grayscale(15%);
    transition: filter 0.25s ease;
}

.frame img:hover {
    filter: grayscale(0%);
}

figcaption {
    margin-top: 14px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--ink);
}

/* ========== FOOTER ========== */
.content-footer {
    margin-top: 90px;
    padding-top: 24px;
    border-top: 1px solid var(--hairline);
}

.content-footer p {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

/* ========== LIGHTBOX ========== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 13, 11, 0.92);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: zoom-out;
}

.lightbox img {
    max-width: 88%;
    max-height: 88%;
    border-radius: 4px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 100%;
    }

    .sidebar {
        position: static;
        min-height: 340px;
        padding: 40px 28px;
    }

    .content {
        margin-left: 0;
        padding: 50px 6vw 50px;
    }

    .gallery {
        grid-template-columns: 1fr;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    figure img {
        transition: none;
    }
}
