:root {
    color-scheme: dark;
    --background: #0d0c0b;
    --surface: #171513;
    --surface-raised: #211e1b;
    --text: #f4efe6;
    --muted: #aaa39a;
    --accent: #ef6958;
    --accent-soft: #f4b4a9;
    --line: rgba(244, 239, 230, 0.16);
    --content: 76rem;
    --radius: 0.25rem;
    --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    --sans: Aptos, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    min-width: 20rem;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

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

button {
    font: inherit;
}

a {
    color: inherit;
}

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

.skip-link {
    position: fixed;
    z-index: 100;
    top: 1rem;
    left: 1rem;
    padding: 0.65rem 1rem;
    transform: translateY(-200%);
    border-radius: var(--radius);
    background: var(--text);
    color: var(--background);
}

.skip-link:focus {
    transform: none;
}

:focus-visible {
    outline: 0.2rem solid var(--accent-soft);
    outline-offset: 0.25rem;
}

.hero {
    position: relative;
    display: grid;
    min-height: min(54rem, 100svh);
    overflow: hidden;
    background:
        linear-gradient(
            90deg,
            rgba(8, 7, 6, 0.94) 0%,
            rgba(8, 7, 6, 0.72) 42%,
            rgba(8, 7, 6, 0.18) 72%,
            rgba(8, 7, 6, 0.06) 100%
        ),
        linear-gradient(0deg, rgba(8, 7, 6, 0.76) 0%, transparent 44%),
        url("/photos/kyoto/kyoto_16.jpg") 58% center / cover no-repeat;
    isolation: isolate;
}

.site-nav,
.hero__content,
.hero__caption {
    width: min(calc(100% - 3rem), var(--content));
    margin-right: auto;
    margin-left: auto;
}

.site-nav {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    align-self: start;
    justify-content: space-between;
    padding: 1.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.73rem;
    font-weight: 650;
    letter-spacing: 0.15em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-brand img {
    width: 2.6rem;
    height: 2.6rem;
    object-fit: contain;
}

.site-nav__links {
    display: flex;
    gap: clamp(1rem, 4vw, 2.5rem);
}

.site-nav__links a {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav__links a:hover {
    color: var(--accent-soft);
}

.hero__content {
    align-self: end;
    padding: clamp(3.25rem, 7vh, 5rem) 0;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2 {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

h1 {
    max-width: 13ch;
    margin-bottom: 1.5rem;
    font-size: clamp(4.2rem, min(10vw, 15vh), 8.8rem);
    text-wrap: balance;
}

h1 em {
    color: var(--accent-soft);
    font-weight: 400;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(2.6rem, 6vw, 4.8rem);
}

.eyebrow {
    margin-bottom: 0.7rem;
    color: var(--accent-soft);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero__intro {
    max-width: 34rem;
    margin-bottom: 2rem;
    color: #e4ded5;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.65;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 100vmax;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.primary-action {
    background: var(--text);
    color: #17120f;
}

.secondary-action {
    background: rgba(9, 8, 7, 0.42);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(0.35rem);
}

.secondary-action:disabled {
    cursor: wait;
    opacity: 0.55;
}

.primary-action:hover,
.secondary-action:hover:not(:disabled) {
    transform: translateY(-0.12rem);
}

.primary-action:hover {
    background: var(--accent-soft);
}

.secondary-action:hover:not(:disabled) {
    border-color: var(--accent-soft);
    color: var(--accent-soft);
}

.hero__caption {
    position: absolute;
    right: 0;
    bottom: 1.5rem;
    left: 0;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-align: right;
    text-transform: uppercase;
}

.gallery-shell {
    width: min(calc(100% - 3rem), var(--content));
    margin: 0 auto;
}

.gallery-shell>section:first-child {
    padding-top: clamp(5rem, 11vw, 9rem);
}

.section-heading,
.album-toolbar,
.film,
footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
}

.section-heading {
    margin-bottom: 2.2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.section-intro {
    margin: 1rem 0 0;
    color: var(--muted);
}

.status,
.muted {
    margin-bottom: 0;
    color: var(--muted);
}

.status {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 100vmax;
    font-size: 0.75rem;
    white-space: nowrap;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.8rem, 2.5vw, 1.6rem);
}

.album-card,
.photo-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.album-card:first-child {
    grid-column: span 2;
}

.album-card__image {
    aspect-ratio: 3 / 2;
    width: 100%;
    object-fit: cover;
    transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 450ms ease;
}

.album-card:first-child .album-card__image {
    aspect-ratio: 16 / 7;
}

.album-card::after {
    position: absolute;
    inset: 26% 0 0;
    content: "";
    background: linear-gradient(transparent, rgba(5, 4, 3, 0.92));
    pointer-events: none;
}

.album-card__label {
    position: absolute;
    z-index: 1;
    right: clamp(1rem, 3vw, 1.7rem);
    bottom: clamp(1rem, 3vw, 1.5rem);
    left: clamp(1rem, 3vw, 1.7rem);
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.album-card__copy {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 0.75rem;
}

.album-card__position {
    grid-row: span 2;
    color: var(--accent-soft);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.album-card__name {
    font-family: var(--display);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 1;
}

.album-card__description {
    margin-top: 0.45rem;
    color: #d7d0c7;
    font-size: 0.78rem;
}

.album-card__count {
    padding-bottom: 0.1rem;
    color: #ede8df;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-transform: uppercase;
}

.album-card:hover .album-card__image,
.album-card:focus-visible .album-card__image,
.photo-card:hover img,
.photo-card:focus-visible img {
    filter: brightness(0.78) saturate(1.08);
    transform: scale(1.035);
}

.album-toolbar {
    align-items: start;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.text-button,
.icon-button,
.lightbox__nav {
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.text-button {
    padding: 0.65rem 0;
    color: var(--accent-soft);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
}

.text-button:hover {
    color: var(--text);
}

.album-toolbar>div {
    text-align: right;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.45rem, 1.2vw, 0.85rem);
}

.photo-card img {
    aspect-ratio: 3 / 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 450ms ease, filter 300ms ease;
}

.notice,
.film {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.notice {
    padding: 1rem;
}

.film {
    position: relative;
    min-height: 24rem;
    margin: clamp(5rem, 12vw, 10rem) 0;
    overflow: hidden;
    padding: clamp(1.5rem, 5vw, 3.5rem);
    background:
        linear-gradient(90deg, rgba(12, 10, 9, 0.94), rgba(12, 10, 9, 0.58)),
        url("/photos/okinawa/okinawa_1.jpg") center / cover no-repeat;
}

.film::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0.28rem;
    content: "";
    background: var(--accent);
}

.film>* {
    position: relative;
}

.film h2 {
    max-width: 8ch;
}

.film p:not(.eyebrow) {
    max-width: 29rem;
    margin: 1rem 0 0;
    color: #d4cec6;
}

.film__link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
}

.film__play {
    display: grid;
    width: 3.6rem;
    height: 3.6rem;
    place-items: center;
    padding-left: 0.15rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.film__link:hover .film__play {
    transform: scale(1.06);
    background: var(--text);
    color: var(--background);
}

footer {
    width: min(calc(100% - 3rem), var(--content));
    margin: 0 auto;
    padding: 0 0 2.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

footer p {
    margin: 0;
}

footer a {
    text-underline-offset: 0.25em;
}

.lightbox {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(7, 6, 5, 0.98);
    color: var(--text);
}

.lightbox::backdrop {
    background: rgba(7, 6, 5, 0.98);
}

.lightbox__toolbar {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.lightbox__toolbar p {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.icon-button {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 2rem;
    line-height: 1;
}

.lightbox__stage {
    display: grid;
    grid-template-columns: minmax(3rem, 8vw) minmax(0, 1fr) minmax(3rem, 8vw);
    align-items: center;
    height: 100%;
    touch-action: pan-y pinch-zoom;
}

.lightbox figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 4rem 0 1rem;
}

.lightbox figure img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100dvh - 7rem);
    object-fit: contain;
    opacity: 1;
    transition: opacity 180ms ease;
}

.lightbox figure img.is-loading {
    opacity: 0.18;
}

.lightbox figcaption {
    min-height: 2rem;
    padding-top: 0.5rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.lightbox__nav {
    height: 7rem;
    font-family: var(--display);
    font-size: clamp(2.5rem, 7vw, 5rem);
}

.lightbox__nav:hover:not(:disabled) {
    color: var(--accent-soft);
}

.lightbox__nav:disabled {
    cursor: default;
    opacity: 0.2;
}

body:has(dialog[open]) {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

@media (max-width: 48rem) {
    .hero {
        min-height: 48rem;
        background:
            linear-gradient(
                0deg,
                rgba(8, 7, 6, 0.94) 0%,
                rgba(8, 7, 6, 0.38) 70%,
                rgba(8, 7, 6, 0.12) 100%
            ),
            url("/photos/kyoto/kyoto_16.jpg") 62% center / cover no-repeat;
    }

    .hero__content {
        padding-bottom: 5.5rem;
    }

    .hero__caption {
        display: none;
    }

    .section-heading,
    .album-toolbar,
    .film,
    footer {
        align-items: start;
        flex-direction: column;
        gap: 1rem;
    }

    .album-toolbar>div {
        text-align: left;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .film {
        align-items: start;
        justify-content: end;
    }

    .lightbox__stage {
        grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
    }
}

@media (max-width: 34rem) {

    .site-nav,
    .hero__content,
    .gallery-shell,
    footer {
        width: min(calc(100% - 2rem), var(--content));
    }

    .site-brand span {
        display: none;
    }

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

    .album-card:first-child {
        grid-column: auto;
    }

    .album-card:first-child .album-card__image,
    .album-card__image {
        aspect-ratio: 4 / 3;
    }

    .album-card__description {
        display: none;
    }

    .album-card__count {
        font-size: 0.65rem;
    }

    .hero__actions>* {
        width: 100%;
    }
}

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

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