@font-face {
    font-family: "Titillium Web";
    src: url("/assets/fonts/titillium-web-regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Titillium Web";
    src: url("/assets/fonts/titillium-web-bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    --background: #ffffff;
    --surface: #ffffff;
    --text: #282828;
    --muted: #999999;
    --line: #dddddd;
    --media-background: #ffffff;
    --focus: #282828;
    --copy-width: 50rem;
    font-family: "Titillium Web", "Helvetica Neue", Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--background);
    scroll-behavior: smooth;
}

body {
    min-width: 20rem;
    margin: 0;
    background: var(--background);
    color: var(--text);
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 0.1875rem solid var(--focus);
    outline-offset: 0.1875rem;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.65rem 0.85rem;
    transform: translateY(-150%);
    background: var(--text);
    color: var(--background);
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    display: flex;
    height: 10rem;
    align-items: center;
    justify-content: center;
    padding: 0 4%;
}

.site-title {
    padding: 0.5rem;
    font-size: 2.1875rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
}

#app {
    width: 100%;
    outline: none;
}

.stream,
.single-photo {
    width: 92%;
    margin: 0 auto;
    padding: 0 0 5rem;
}

.page-intro {
    width: min(var(--copy-width), calc(100% - 2rem));
    margin: clamp(2.5rem, 9vw, 7rem) auto clamp(2.5rem, 6vw, 5rem);
}

.page-intro h1,
.empty-state h1 {
    margin: 0;
    font-size: clamp(2.25rem, 6vw, 3.75rem);
    font-weight: 400;
    line-height: 1.13;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.back-link,
.text-link {
    text-underline-offset: 0.22em;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 1rem clamp(1rem, 2.5vw, 2rem) 3rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.day-divider {
    display: grid;
    grid-template-columns: auto minmax(2rem, 1fr);
    gap: 1rem;
    align-items: center;
    width: 100%;
    margin: clamp(3.5rem, 7vw, 6rem) 0 1.5rem;
}

.day-divider:first-child {
    margin-top: 0;
}

.day-divider::after {
    height: 1px;
    background: var(--line);
    content: "";
}

.day-divider a {
    font-size: 1.1875rem;
    font-weight: 400;
    letter-spacing: 0.025em;
    text-decoration: none;
    text-transform: uppercase;
}

.day-divider a:hover {
    text-decoration: underline;
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.18em;
}

.photo-card {
    margin: 0 0 clamp(3rem, 6vw, 5.5rem);
}

.photo-media-button {
    display: block;
    width: 100%;
    min-height: 8rem;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--media-background);
    color: white;
    cursor: zoom-in;
    line-height: 0;
}

.photo-media-button picture,
.photo-media-button img {
    display: block;
    width: 100%;
}

.photo-media-button img {
    max-height: calc(100svh - 2rem);
    object-fit: contain;
}

.photo-copy {
    display: grid;
    width: min(var(--copy-width), calc(100% - 2rem));
    margin: 1.25rem auto 0;
    gap: 0.65rem;
}

.photo-caption {
    max-width: 46rem;
    margin: 0;
    font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
    font-weight: 400;
    line-height: 1.5;
    white-space: pre-line;
}

.photo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

.photo-permalink {
    font-weight: 400;
    text-decoration: none;
}

.photo-permalink:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.load-sentinel {
    display: grid;
    min-height: 8rem;
    place-items: center;
    color: var(--muted);
    font-size: 0.8rem;
}

.loading-state,
.empty-state,
.error-state {
    display: grid;
    min-height: calc(100svh - 10rem);
    padding: 3rem 1rem;
    place-content: center;
    text-align: center;
}

.loading-state {
    grid-auto-flow: column;
    gap: 0.75rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.loading-mark {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    animation: pulse 1.1s ease-in-out infinite alternate;
    background: currentColor;
}

.empty-state,
.error-state {
    gap: 1rem;
}

.empty-state p,
.error-state p {
    margin: 0;
}

.single-navigation {
    display: flex;
    width: min(var(--copy-width), calc(100% - 2rem));
    justify-content: space-between;
    margin: -2rem auto 5rem;
    gap: 1rem;
}

.single-navigation a {
    color: var(--muted);
    font-size: 0.78rem;
    text-underline-offset: 0.2em;
}

.single-navigation .next-photo {
    margin-left: auto;
    text-align: right;
}

.viewer {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #080808;
    color: #fff;
}

.viewer::backdrop {
    background: #080808;
}

.viewer-frame {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-rows: 1fr auto;
}

.viewer-toolbar {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0 max(0.75rem, env(safe-area-inset-left));
    pointer-events: none;
}

.viewer-control,
.viewer-nav {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(18, 18, 18, 0.7);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.viewer-control svg,
.viewer-nav svg {
    width: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.viewer-image {
    display: grid;
    min-width: 0;
    min-height: 0;
    padding: max(3.75rem, env(safe-area-inset-top)) 0 1rem;
    place-items: center;
    touch-action: pan-y pinch-zoom;
}

.viewer-image picture,
.viewer-image img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.viewer-image img {
    width: auto;
    height: auto;
    object-fit: contain;
}

.viewer-caption {
    z-index: 2;
    max-height: 28vh;
    overflow: auto;
    padding: 0.8rem max(4.5rem, env(safe-area-inset-right)) max(0.9rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.82) 35%);
    font-size: 0.95rem;
    line-height: 1.45;
}

.viewer-caption:empty {
    display: none;
}

.viewer-nav {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
}

.viewer-previous {
    left: max(0.6rem, env(safe-area-inset-left));
}

.viewer-next {
    right: max(0.6rem, env(safe-area-inset-right));
}

.viewer-nav:disabled {
    visibility: hidden;
}

.noscript {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    margin: 0;
    padding: 1rem;
    background: #8b1d1d;
    color: #fff;
    text-align: center;
}

@keyframes pulse {
    to {
        opacity: 0.25;
        transform: scale(0.75);
    }
}

@media (max-width: 58.25rem) {
    .site-header {
        height: 7rem;
        padding-right: 5%;
        padding-left: 5%;
    }

    .site-title {
        font-size: 2.0625rem;
    }

    .stream,
    .single-photo {
        width: 100%;
        padding-bottom: 3rem;
    }

    .day-divider {
        width: 90%;
        margin-right: auto;
        margin-left: auto;
    }

    .photo-card {
        margin-bottom: 3.25rem;
    }

    .photo-media-button img {
        height: auto;
        max-height: none;
    }

    .back-link {
        margin-right: 5%;
        margin-left: 5%;
    }

    .viewer-nav {
        top: auto;
        bottom: max(0.6rem, env(safe-area-inset-bottom));
        transform: none;
    }

    .viewer-caption {
        padding-right: 4.5rem;
        padding-bottom: max(4.2rem, calc(env(safe-area-inset-bottom) + 3.5rem));
    }
}

@media (max-width: 33.75rem) {
    .site-header {
        height: 5.5rem;
    }

    .site-title {
        font-size: 1.4375rem;
    }

    .loading-state,
    .empty-state,
    .error-state {
        min-height: calc(100svh - 5.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
