:root {
    --ink: #252121;
    --line: #252121;
    --page: #f5f5f5;
    --pale: #dae5e6;
    --field: #ffffff;
    --field-line: #252121;
    --solid: #252121;
    --on-solid: #ffffff;
    --bar: #252121;
    --orange: #f26822;
    --muted: #5f6a6b;
    --danger: #a3271c;
    --danger-surface: #fbe4df;

    --sans: Montserrat, "Segoe UI", system-ui, sans-serif;
    --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;

    --wide: 68rem;
    --reading: 42rem;
    --gutter: 2.5rem;
    --pill: 25px;
}

/* Dark mode, switched on with the button in the header */
:root[data-theme="dark"] {
    color-scheme: dark;

    --ink: #ffffff;
    --line: rgb(255 255 255 / 0.2);
    --page: #2c2b2b;
    --pale: #212223;
    --field: #212223;
    --field-line: rgb(255 255 255 / 0.45);
    --solid: #ffffff;
    --on-solid: #252121;
    --bar: #000000;
    --muted: #aab1b2;
    --danger: #ff9d8f;
    --danger-surface: #4a2622;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.125rem;
    line-height: 1.65;
}

main {
    flex: 1;
}

h1,
h2 {
    margin: 0;
    font-family: var(--sans);
    font-weight: 700;
    line-height: 1.2;
    text-wrap: balance;
}

a {
    color: var(--ink);
    font-weight: 600;
    text-underline-offset: 0.2em;
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* Header */

.masthead {
    background: var(--pale);
    border-bottom: 1px solid var(--line);
}

.masthead-inner,
.footer-inner,
.wrap {
    max-width: var(--wide);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.masthead-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 2.5rem;
    padding-block: 1.4rem;
}

.masthead-name {
    font: 700 1.0625rem/1.2 var(--sans);
    letter-spacing: 0.02em;
    text-decoration: none;
    text-transform: uppercase;
}

.sections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.75rem;
}

.sections a {
    padding-block: 0.2rem;
    border-bottom: 2px solid transparent;
    font: 500 0.8125rem/1.2 var(--sans);
    letter-spacing: 0.02em;
    text-decoration: none;
    text-transform: uppercase;
}

.sections a:hover,
.sections a[aria-current] {
    border-bottom-color: var(--ink);
}

.sections a[aria-current] {
    font-weight: 700;
}

.masthead-account {
    margin: 0;
}

.badge {
    display: inline-block;
    min-width: 1.3rem;
    margin-left: 0.2rem;
    padding: 0 0.4rem;
    border-radius: 1rem;
    background: var(--orange);
    color: #252121;
    font-weight: 700;
    line-height: 1.3rem;
    text-align: center;
}

/* Title band at the top of every page */

.hero {
    padding: 1.5rem var(--gutter);
    background: var(--pale);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.2rem, 6.4vw, 4rem);
    overflow-wrap: anywhere;
}

.hero > p {
    max-width: 38rem;
    margin: 1rem auto 0;
}

.back {
    display: inline-block;
    margin-bottom: 1rem;
    font: 600 0.8125rem/1.2 var(--sans);
    text-transform: uppercase;
}

/* The page's main action, under the title */

.hero .hero-action {
    margin-top: 1.6rem;
}

.uploader summary {
    display: inline-block;
    list-style: none;
    cursor: pointer;
}

.uploader summary::-webkit-details-marker {
    display: none;
}

.uploader[open] summary .button {
    background: none;
    color: var(--ink);
}

.uploader form {
    max-width: var(--reading);
    margin: 1.75rem auto 0;
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: var(--pill);
    background: var(--page);
    text-align: left;
}

.uploader form > .button {
    margin-top: 1.5rem;
}

.uploader .form-error {
    margin: 0 0 1.5rem;
}

/* Page content */

.wrap {
    padding-block: 4rem 6rem;
}

.wrap-narrow {
    max-width: calc(var(--reading) + 2 * var(--gutter));
}

.empty {
    margin: 0;
    font-style: italic;
}

.list-heading {
    margin: 0 0 1rem;
    font: 500 1.125rem/1.3 var(--sans);
    text-transform: uppercase;
}

/* Buttons */

.button {
    display: inline-block;
    padding: 1rem 1.9rem;
    border: 1px solid var(--solid);
    border-radius: var(--pill);
    background: var(--solid);
    color: var(--on-solid);
    font: 600 0.8125rem/1 var(--sans);
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.button:hover {
    background: var(--page);
    color: var(--ink);
}

.button-quiet {
    background: none;
    color: var(--ink);
}

.button-quiet:hover {
    background: var(--solid);
    color: var(--on-solid);
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: 500 0.75rem/1.4 var(--sans);
    text-transform: uppercase;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.link-button.danger {
    color: var(--muted);
}

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

/* Updates */

.letter {
    max-width: var(--reading);
    margin-inline: auto;
    padding-bottom: 3rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--line);
}

.letter:last-of-type {
    margin-bottom: 0;
    border-bottom: 0;
}

.postmark {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.6rem;
    margin: 0 0 0.75rem;
    font: 500 0.8125rem/1.5 var(--sans);
    text-transform: uppercase;
}

.letter h2 {
    margin-bottom: 1.25rem;
    font-size: clamp(1.75rem, 4.5vw, 2.5rem);
}

.letter-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.letter-admin {
    margin-top: 1.5rem;
}

.paging {
    display: flex;
    justify-content: space-between;
    max-width: var(--reading);
    margin: 3rem auto 0;
}

.paging-older {
    margin-left: auto;
}

/* Forms */

.sheet {
    max-width: 24rem;
    margin: 0 auto;
    text-align: left;
}

p.sheet {
    text-align: center;
}

label {
    display: block;
    margin: 1.4rem 0 0.45rem;
    font: 600 0.8125rem/1.3 var(--sans);
    text-transform: uppercase;
}

form > label:first-child {
    margin-top: 0;
}

input:not([type="file"]),
textarea,
select {
    width: 100%;
    padding: 0.8rem 1.25rem;
    border: 1px solid var(--field-line);
    border-radius: var(--pill);
    background: var(--field);
    color: var(--ink);
    font: 400 0.9375rem/1.4 var(--sans);
}

textarea {
    padding: 1rem 1.25rem;
    font: 400 1.0625rem/1.65 var(--serif);
    resize: vertical;
}

input[type="file"] {
    max-width: 100%;
    font: 400 0.875rem/1.4 var(--sans);
}

.hint {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font: 400 0.8125rem/1.5 var(--sans);
}

.sheet form > .button,
.form-actions {
    margin-top: 1.75rem;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.form-error,
.notice {
    margin: 0 0 1.75rem;
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--pill);
    font: 500 0.875rem/1.5 var(--sans);
}

.form-error {
    border-color: var(--danger);
    background: var(--danger-surface);
    color: var(--danger);
}

.notice {
    background: var(--pale);
}

.sheet-footer {
    margin: 1.75rem 0 0;
}

/* Albums */

.albums {
    display: grid;
    gap: 2rem 1.5rem;
    margin: 0 0 4rem;
    padding: 0;
    list-style: none;
}

.albums:last-child {
    margin-bottom: 0;
}

.albums-photos {
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.albums a {
    display: block;
    text-decoration: none;
}

.albums img,
.album-blank {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-bottom: 0.9rem;
    border: 1px solid var(--line);
    object-fit: cover;
    background: var(--pale);
}

.albums-music {
    gap: 0;
    border-top: 1px solid var(--line);
}

.albums-music a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--line);
}

.album-title {
    display: block;
    font: 700 1.125rem/1.35 var(--sans);
    overflow-wrap: anywhere;
}

.albums a:hover .album-title {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.album-count {
    flex: none;
    font: 500 0.8125rem/1.5 var(--sans);
    text-transform: uppercase;
}

.photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.75rem;
}

.photos a {
    display: block;
}

.photos img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--pale);
}

.photo form {
    margin-top: 0.3rem;
}

.album-admin {
    margin-top: 3rem;
}

/* Track list and player */

.playlist {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
    list-style: none;
    counter-reset: track;
}

.playlist li {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    counter-increment: track;
}

.track {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    min-width: 0;
    padding: 1.1rem 0.5rem 1.1rem 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: 700 1.0625rem/1.35 var(--sans);
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.track::before {
    content: counter(track, decimal-leading-zero);
    flex: none;
    width: 1.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

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

.track[aria-current]::before {
    content: "";
    align-self: center;
    width: 0.8rem;
    height: 0.8rem;
    margin-right: 0.95rem;
    border-radius: 50%;
    background: var(--orange);
}

.player {
    position: fixed;
    inset: auto 0 0 0;
    background: var(--bar);
    color: #fff;
}

.player-inner {
    max-width: var(--wide);
    margin-inline: auto;
    padding: 0.9rem var(--gutter) 1.1rem;
}

.player-now {
    margin: 0 0 0.6rem;
    font: 700 0.9375rem/1.3 var(--sans);
    overflow-wrap: anywhere;
}

.player audio {
    display: block;
    width: 100%;
    height: 2.5rem;
}

.has-player .footer {
    padding-bottom: 7rem;
}

/* Large photo view */

.viewer {
    max-width: 96vw;
    max-height: 96vh;
    padding: 0.75rem;
    border: 1px solid var(--line);
    background: var(--page);
    color: var(--ink);
}

.viewer::backdrop {
    background: rgb(37 33 33 / 0.88);
}

.viewer img {
    display: block;
    max-width: 100%;
    max-height: calc(96vh - 6.5rem);
    margin-inline: auto;
    cursor: pointer;
}

.viewer form {
    margin-top: 0.75rem;
    text-align: right;
}

/* Members */

.people {
    margin: 0 0 3.5rem;
    padding: 0;
    border-top: 1px solid var(--line);
    list-style: none;
}

.people li {
    border-bottom: 1px solid var(--line);
}

.person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 1.25rem 0;
}

summary.person {
    list-style: none;
    cursor: pointer;
}

summary.person::-webkit-details-marker {
    display: none;
}

.person-who {
    display: block;
    min-width: 0;
}

.person-name {
    display: block;
    font: 700 1.125rem/1.35 var(--sans);
    overflow-wrap: anywhere;
}

.person-meta {
    display: block;
    margin-top: 0.15rem;
    font: 400 0.875rem/1.5 var(--sans);
    color: var(--muted);
    overflow-wrap: anywhere;
}

.person-actions {
    display: flex;
    gap: 0.5rem;
}

.person-edit {
    font: 600 0.8125rem/1 var(--sans);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-transform: uppercase;
}

details[open] > summary .person-edit {
    visibility: hidden;
}

.tag {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--field-line);
    border-radius: 1rem;
    font: 600 0.6875rem/1.2 var(--sans);
    text-transform: uppercase;
    vertical-align: 0.15em;
}

.person-form {
    max-width: 24rem;
    padding-bottom: 1.75rem;
}

.person-form .form-error {
    margin: 0 0 1.25rem;
}

.person-remove {
    padding-bottom: 1.5rem;
}

/* Footer */

.footer {
    background: var(--bar);
    color: #fff;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    padding-block: 2.25rem;
    font-size: 0.9375rem;
}

.footer-name {
    font: 700 0.9375rem/1.2 var(--sans);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

@media (max-width: 40rem) {
    :root {
        --gutter: 1.25rem;
    }

    .hero {
        padding-block: 2.4rem;
    }

    .wrap {
        padding-block: 2.5rem 4rem;
    }

}

/* Light and dark switch */

.theme-toggle {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--page);
}

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.theme-toggle .moon,
:root[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .moon {
    display: block;
}


/* Where you are: the albums or folders above this one */

.trail {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.6rem;
    margin-bottom: 1rem;
    font: 600 0.8125rem/1.4 var(--sans);
    text-transform: uppercase;
}

.trail a + a::before {
    content: "/";
    display: inline-block;
    margin-right: 0.6rem;
    font-weight: 400;
}

/* Download and remove, next to a photo or track */

.item-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 1rem;
}

.photo .item-actions {
    justify-content: space-between;
    margin-top: 0.3rem;
}

a.link-button {
    text-decoration: none;
}

a.link-button:hover {
    text-decoration: underline;
}

.viewer form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
}

/* Files */

.files {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
    list-style: none;
}

.files li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6rem 7rem 6rem;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.file-name {
    font: 700 1.0625rem/1.35 var(--sans);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.file-name:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.file-meta {
    color: var(--muted);
    font: 400 0.8125rem/1.5 var(--sans);
}

.file-action {
    text-align: right;
}

@media (max-width: 40rem) {
    .files li {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .file-date {
        display: none;
    }

    .file-action {
        grid-column: 1 / -1;
        text-align: left;
    }
}

.path {
    font-weight: 600;
    overflow-wrap: anywhere;
}
