/* Rhune-held artist and release pages. Colour comes from the page's accent and the
   artwork; track notes keep the entry page's own card. The cover stays still while a
   paper sheet rises over it; once the sheet covers the title, the header turns solid
   and carries the title (static/rhune_pages.js sets .rhune-collapsed). */
.rhune-page {
    --rhune-ink: #3f3c39;
    --rhune-deep: #171615;
    --rhune-muted: #77716a;
    --rhune-line: rgba(63, 60, 57, 0.12);
    --rhune-paper: var(--rh-paper, #f1efe9);
    --rhune-card: #fbf9f5;
    --rhune-on-deep: #f1efe9;
    --rhune-on-deep-muted: rgba(241, 239, 233, 0.7);
    --rhune-accent: #3f3c39;
    --rhune-accent-text: var(--rhune-accent);
    --rhune-gutter: 20px;
    --rhune-bar-height: 52px;
    --rhune-stick: 0px;
    --curator-reading-card: var(--rhune-card);
    display: block;
    min-height: 100%;
    background: var(--rhune-paper);
    color: var(--rhune-ink);
    font: 400 16px/1.5 var(--rh-sans);
}
body.dark-mode .rhune-page {
    --rhune-ink: #e7e3db;
    --rhune-muted: #a7a098;
    --rhune-line: rgba(231, 227, 219, 0.1);
    --rhune-card: #1c1b1a;
    --rhune-deep: #0b0b0b;
}
body.rhune-page-body > main#main { max-width: none; margin: 0; padding: 0; }
main.rhune-page { width: 100%; max-width: none; margin: 0; padding: 0; }
.rhune-page * { font-family: inherit; }
.rhune-page :is(p, h1, h2, h3, h4, ol) { margin: 0; }
.rhune-page :is(h1, h2, h3, h4) { color: inherit; font-weight: 500; }
.rhune-page a { color: inherit; text-decoration: none; }
.rhune-page img { display: block; }
.rhune-page em { font-style: normal; }

/* The Rhune mark: the verification rosette in ink, reversed on dark grounds. */
.rhune-seal { display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; vertical-align: -2px; }
/* Fallbacks keep the mark whole where these styles outlive the page, e.g. back on the Board. */
.rhune-seal--ink .rhune-seal-body { fill: var(--rhune-ink, var(--rh-ink, #3f3c39)); }
.rhune-seal--ink .rhune-seal-tick { stroke: var(--rhune-paper, var(--rh-paper, #f1efe9)); }
.rhune-seal--paper .rhune-seal-body { fill: var(--rhune-on-deep, #f1efe9); }
.rhune-seal--paper .rhune-seal-tick { stroke: var(--rhune-deep, #171615); }

/* The cover fills the safe area; the controls sit below it. */
.curator-app-detail-surface > main.rhune-page {
    --rhune-bar-height: var(--curator-app-header-height, 56px);
    width: auto;
    margin: 0 calc(-1 * var(--curator-app-gutter-right, 0px)) 0 calc(-1 * var(--curator-app-gutter-left, 0px));
}
.rhune-cover-space { display: none; }

@media (max-width: 1100px) {
    .curator-app-detail-surface:has(> main.rhune-page) {
        /* Padding on the scrollport moves sticky layers during rubber-banding. */
        padding-top: 0;
        scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--curator-app-header-height, 56px));
        overflow-anchor: none;
        scroll-snap-type: none;
    }
    body.curator-app-shell-page.rhune-page-body > .site-header,
    body.curator-app-shell-page .curator-app-detail-surface:has(> main.rhune-page) > .site-header {
        position: fixed;
        z-index: 6;
        inset: env(safe-area-inset-top, 0px) 0 auto;
        width: auto;
        margin: 0;
        background: transparent;
        transition: background-color 0.2s ease;
    }
    /* This backing belongs to the fixed header, so scrolled writing cannot
       show through the status area or pull its cover down during a bounce. */
    body.curator-app-shell-page .curator-app-detail-surface:has(> main.rhune-page) > .site-header::before {
        content: "";
        position: absolute;
        top: calc(-1 * env(safe-area-inset-top, 0px));
        right: 0;
        left: 0;
        height: calc(env(safe-area-inset-top, 0px) + min(2px, env(safe-area-inset-top, 0px)));
        background: var(--rh-paper, #f1efe9);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.curator-app-shell-page .curator-app-detail-surface.rhune-collapsed:has(> main.rhune-page) > .site-header {
        background: var(--rh-paper, #f1efe9);
        box-shadow: 0 1px 0 var(--rh-line, rgba(63, 60, 57, 0.08));
    }
    body.curator-app-shell-page .curator-app-detail-surface.rhune-collapsed:has(> main.rhune-page) > .site-header::before { opacity: 1; }
    .rhune-fixed-cover > .rhune-cover-space {
        display: block;
        height: var(--rhune-cover-height);
    }
    .curator-app-detail-surface > main.rhune-fixed-cover > .rhune-cover {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: auto;
        will-change: transform;
        /* Let cover swipes reach the normal-flow spacer in the scroll surface,
           so the browser moves the sheet with its usual momentum and bounce. */
        pointer-events: none;
    }
    .curator-app-detail-surface > main.rhune-fixed-cover > .rhune-cover :is(a, button) {
        pointer-events: auto;
    }
    .curator-app-detail-surface > main.rhune-page > .rhune-sheet {
        /* Even a short page can raise its sheet all the way to the header. */
        min-height: calc(100dvh - env(safe-area-inset-top, 0px) - var(--rhune-bar-height) - var(--curator-app-bottom-clearance, 0px));
    }
}
/* Colour only: over the cover the standard controls reverse to paper. */
html body.rhune-page-body.curator-entry-page.curator-app-shell-page:not(.curator-artist-detail-page) .curator-app-detail-surface:not(.rhune-collapsed) > .site-header :is(.curator-app-header-back, .curator-save--header .curator-save-button) {
    background: rgba(20, 19, 18, 0.32);
    color: #f1efe9;
}
.rhune-page-body .site-header :is(.curator-app-header-back, .curator-save--header .curator-save-button) { transition: background-color 0.2s ease, color 0.2s ease; }
.rhune-header-title { display: none; }
.site-header .rhune-header-title {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 72px;
    left: 72px;
    display: block;
    margin: 0;
    overflow: hidden;
    color: var(--rh-ink, #3f3c39);
    font: 500 16px/1.2 var(--rh-sans);
    letter-spacing: -0.03em;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(calc(-50% + 6px));
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}
.rhune-collapsed > .site-header .rhune-header-title { opacity: 1; transform: translateY(-50%); }

/* Outside the app: the page's own bar, with the same behaviour. */
.rhune-bar {
    position: sticky;
    z-index: 6;
    top: 0;
    display: flex;
    align-items: center;
    height: var(--rhune-bar-height);
    margin-bottom: calc(-1 * var(--rhune-bar-height));
    padding: 0 8px;
    color: var(--rhune-on-deep);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
body.curator-app-shell-page .rhune-bar { display: none; }
.rhune-bar-back { display: grid; place-items: center; width: 44px; height: 44px; }
.rhune-bar-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rhune-bar-title {
    position: absolute;
    margin: 0;
    right: 64px;
    left: 64px;
    overflow: hidden;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.03em;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.rhune-collapsed .rhune-bar { background: var(--rhune-paper); color: var(--rhune-ink); box-shadow: 0 1px 0 var(--rhune-line); }
.rhune-collapsed .rhune-bar-title { opacity: 1; transform: none; }

/* Cover: still, with the title over it. */
.rhune-cover {
    position: sticky;
    z-index: 0;
    top: var(--rhune-stick);
    margin: 0;
    overflow: hidden;
    background: var(--rhune-deep);
    color: var(--rhune-on-deep);
}
.rhune-kicker { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.rhune-title { margin-top: 10px !important; font-size: 52px; font-weight: 500; line-height: 0.94; letter-spacing: -0.06em; overflow-wrap: anywhere; }
.rhune-cover-meta { margin-top: 10px !important; font-size: 15px; color: var(--rhune-on-deep-muted); }
.rhune-byline { margin-top: 10px !important; font-size: 16px; }
.rhune-byline a { font-weight: 500; }
.rhune-byline span { color: var(--rhune-on-deep-muted); }

.rhune-portrait { height: calc(min(122vw, 580px) + env(safe-area-inset-top, 0px)); }
.rhune-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; filter: grayscale(1) contrast(1.12); }
.rhune-portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 7, 6, 0.36) 0%, rgba(8, 7, 6, 0) 22%, rgba(8, 7, 6, 0) 42%, rgba(8, 7, 6, 0.5) 66%, rgba(8, 7, 6, 0.86) 100%);
    pointer-events: none;
}
/* The bottom gradient carries legibility; a soft shadow holds the type over pale photographs. */
.rhune-portrait .rhune-cover-text { text-shadow: 0 1px 2px rgba(8, 7, 6, 0.3), 0 0 22px rgba(8, 7, 6, 0.45); }
.rhune-portrait .rhune-cover-text { position: absolute; z-index: 2; right: calc(var(--rhune-gutter) + 44px); bottom: 42px; left: var(--rhune-gutter); }
.rhune-portrait .rhune-spotify { right: calc(var(--rhune-gutter) - 10px); bottom: 32px; }

.rhune-cover--sleeve { padding: calc(var(--rhune-bar-height) + env(safe-area-inset-top, 0px) + 10px) var(--rhune-gutter) 46px; }
.rhune-sleeve-wrap { position: relative; }
.rhune-sleeve { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.8); }
.rhune-sleeve img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rhune-cover--sleeve .rhune-cover-text { margin-top: 28px; }

/* Header actions stay top-right of the cover wherever the app does not hoist them. */
.rhune-cover .rhune-header-actions { position: absolute; z-index: 3; top: max(8px, env(safe-area-inset-top)); right: 8px; display: flex; align-items: center; gap: 4px; color: var(--rhune-on-deep); }
.rhune-header-actions .curator-save-button svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.rhune-header-actions .curator-save-button[aria-pressed="true"] svg { fill: currentColor; }

/* Spotify: an icon over the top image, linking out. */
.rhune-spotify { position: absolute; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; color: var(--rhune-on-deep) !important; }
.rhune-spotify svg { width: 26px; height: 26px; fill: currentColor; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.35)); }
.rhune-sleeve-wrap .rhune-spotify { right: 4px; bottom: 4px; }

/* Artwork reveals as it does elsewhere in the app: neutral backing, then a fade. */
.rhune-page [data-curator-artwork] { background: var(--rh-skeleton-base); }
.rhune-page [data-curator-artwork]:not(.rhune-cover) { position: relative; }
.rhune-page [data-curator-artwork] img { transition: opacity 0.28s ease; }
.rhune-page [data-curator-artwork].is-loading img { opacity: 0; }
.rhune-page [data-curator-artwork].is-error img { display: none; }
.rhune-portrait[data-curator-artwork] { background: var(--rhune-deep); }

/* Sheet */
.rhune-sheet {
    position: relative;
    z-index: 1;
    margin-top: -18px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: var(--rhune-paper);
    box-shadow: 0 -12px 24px -12px rgba(40, 36, 33, 0.07);
}
.rhune-statement { padding: 30px var(--rhune-gutter) 0; }
.rhune-lead { font-size: 29px; font-weight: 500; line-height: 1.08; letter-spacing: -0.05em; }
.rhune-lead em { color: var(--rhune-accent-text); }
.rhune-body { margin-top: 18px !important; font-size: 16px; line-height: 1.6; max-width: 32em; }
.rhune-section-title { padding: 54px var(--rhune-gutter) 16px; font-size: 24px; font-weight: 500; letter-spacing: -0.045em; }
.rhune-section-title span { color: var(--rhune-muted); font-weight: 400; }
.rhune-sheet > .rhune-section-title:first-child { padding-top: 30px; }
/* The app surface already clears the tab bar and home indicator. */
.curator-app-detail-surface > main.rhune-page .rhune-sheet { padding-bottom: 12px; }

/* Releases: each takes its ground from its sleeve. */
.rhune-shelf {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 292px;
    gap: 12px;
    padding: 0 var(--rhune-gutter) 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--rhune-gutter);
    scrollbar-width: none;
}
.rhune-shelf::-webkit-scrollbar { display: none; }
.rhune-shelf--small { grid-auto-columns: 200px; gap: 10px; }
.rhune-release { display: flex; flex-direction: column; min-height: calc(292px * 4 / 3); padding: 22px; background: var(--tone); color: var(--on-tone) !important; scroll-snap-align: start; }
.rhune-release-art { display: block; flex: none; width: 100%; aspect-ratio: 1; overflow: hidden; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.55); }
.rhune-release-art img { width: 100%; height: 100%; object-fit: cover; }
.rhune-release h3 { margin-top: auto !important; padding-top: 16px; font-size: 30px; font-weight: 500; line-height: 0.98; letter-spacing: -0.058em; }
.rhune-release p { margin-top: 7px !important; font-size: 13px; line-height: 1.35; opacity: 0.72; }
.rhune-release--small { min-height: calc(200px * 4 / 3); padding: 16px; }
.rhune-release--small h3 { font-size: 21px; letter-spacing: -0.05em; }
.rhune-release--small p { font-size: 12px; }
.rhune-artist-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 3 / 4; padding: 16px; overflow: hidden; background: var(--rhune-deep); color: var(--rhune-on-deep) !important; scroll-snap-align: start; }
.rhune-artist-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; filter: grayscale(1) contrast(1.15); }
.rhune-artist-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 7, 6, 0) 45%, rgba(8, 7, 6, 0.8) 100%); }
.rhune-artist-card :is(h3, p) { position: relative; z-index: 1; }
.rhune-artist-card h3 { font-size: 21px; font-weight: 500; line-height: 1; letter-spacing: -0.05em; }
.rhune-artist-card p { margin-top: 5px !important; font-size: 12px; opacity: 0.75; }

/* Cards: the entry page's note card, for writing that links elsewhere. */
.rhune-card { box-sizing: border-box; min-width: 0; display: grid; gap: 12px; padding: 18px; border-radius: 4px; background: var(--rhune-card); color: var(--rhune-ink) !important; box-shadow: 0 3px 14px rgba(25, 21, 16, 0.035); }
.rhune-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rhune-card-head h4 { margin: 0; font-size: 17.6px; font-weight: 500; line-height: 1.35; letter-spacing: -0.03em; }
.rhune-card-head span { flex: 0 0 auto; padding-top: 3px; color: var(--rhune-muted); font-size: 10.4px; line-height: 1.3; }
.rhune-card-text { font-size: 16px; line-height: 1.75; letter-spacing: -0.012em; }
.rhune-card-by { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.rhune-card-by .account-verified-seal { width: 13px; height: 13px; flex-basis: 13px; }
.rhune-card-by--curator .account-verified-seal { color: #738894; }
.rhune-writing { display: grid; gap: 12px; padding: 0 var(--rhune-gutter); }

/* Write a note: the viewer's own entry, as the last card in Writing. */
.rhune-write { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rhune-write-head { display: flex; align-items: center; gap: 14px; }
.rhune-write-head img { width: 52px; height: 52px; flex: 0 0 52px; object-fit: cover; }
.rhune-write-head strong { display: block; font-size: 18px; font-weight: 500; line-height: 1.15; letter-spacing: -0.03em; }
.rhune-write-head small { display: block; margin-top: 3px; color: var(--rhune-muted); font-size: 13px; }
.rhune-write-prompt { color: var(--rhune-muted); }
.rhune-write-caret { display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; vertical-align: -0.18em; background: var(--rhune-accent-text); animation: rhune-caret 1.1s steps(1) infinite; }
@keyframes rhune-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rhune-write-caret { animation: none; } }
.rhune-write:disabled { opacity: 0.6; }

/* Tracks */
.rhune-tracks { padding: 0; list-style: none; }
.rhune-track--row { display: grid; grid-template-columns: 26px 1fr; align-items: baseline; margin: 0 var(--rhune-gutter); padding: 13px 0; border-top: 1px solid var(--rhune-line); }
.rhune-track--row span { color: var(--rhune-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rhune-track--row h3 { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; }
.rhune-track--note { padding: 10px var(--rhune-gutter); }
.rhune-tracks .curator-reading-note-row { color: var(--rhune-ink); }

/* Colophon */
.rhune-colophon { background: none; margin: 56px var(--rhune-gutter) 0; padding-top: 22px; border-top: 1px solid var(--rhune-line); }
.rhune-colophon-by { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; }
.rhune-colophon p + p { margin-top: 4px !important; font-size: 13px; line-height: 1.5; color: var(--rhune-muted); }
.rhune-colophon em { font-style: italic; }

@media (min-width: 860px) {
    .rhune-page { --rhune-gutter: max(48px, calc((100% - 1144px) / 2)); }
    .rhune-title { font-size: 80px; }
    .rhune-byline { font-size: 18px; }
    .rhune-statement { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 64px; padding-top: 48px; }
    .rhune-lead { font-size: 40px; }
    .rhune-body { margin-top: 6px !important; }
    .rhune-sheet { margin-top: -24px; border-radius: 24px 24px 0 0; }

    .rhune-portrait { height: min(76vh, 720px); }
    .rhune-portrait .rhune-cover-text { right: calc(var(--rhune-gutter) + 56px); bottom: 64px; }
    .rhune-portrait .rhune-spotify { bottom: 56px; }

    .rhune-cover--sleeve { display: grid; grid-template-columns: 400px minmax(0, 1fr); column-gap: 56px; align-items: end; padding-bottom: 64px; }
    .rhune-cover--sleeve .rhune-cover-text { margin-top: 0; padding-bottom: 6px; }

    .rhune-shelf { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
    .rhune-shelf--small { grid-template-columns: repeat(auto-fill, 220px); }
    .rhune-release { min-height: 0; }
    .rhune-page :is(.rhune-tracks, .rhune-section-title--tracks) { max-width: calc(760px + var(--rhune-gutter) * 2); margin: 0 auto; }
    .rhune-writing { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
    .rhune-colophon { max-width: 1144px; }
}

@media (min-width: 1101px) {
    body.rhune-page-body main.rhune-page { width: calc(100% - var(--curator-sidebar-width, 220px)); margin-left: var(--curator-sidebar-width, 220px); }
}
