/*
 * Mr. Afternoon - static site stylesheet.
 *
 * The complete visual spec is style-notes.md: palette, type, page
 * structure, components, page compositions, mobile. This file is the
 * single source of truth for the static pages AND the Inertia message
 * box page (which links it from the root template), so the whole site
 * stays in sync. Tailwind (resources/css/app.css) is loaded on the
 * message box page for its own utility use, but the chrome and
 * components below are what define the look.
 *
 * Rules: no gradients, no rounded corners on chrome, no shadows.
 * Animation is limited to the old-GIF blink (opacity 1 -> 0.35,
 * steps(1, end), 1s infinite) on the ON SALE! banner and the rss
 * badge, plus the spinning header disc. Always disabled under
 * prefers-reduced-motion.
 */

/* ------------------------------------------------------------------ *
 * Fonts (self-hosted woff2, Fontshare / Indian Type Foundry, OFL)
 * ------------------------------------------------------------------ */

@font-face {
    font-family: "Clash Display";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/font/ClashDisplay-Regular.woff2") format("woff2");
}

@font-face {
    font-family: "Clash Display";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/font/ClashDisplay-Medium.woff2") format("woff2");
}

@font-face {
    font-family: "Clash Display";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/font/ClashDisplay-Bold.woff2") format("woff2");
}

@font-face {
    font-family: "Clash Grotesk";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/font/ClashGrotesk-Regular.woff2") format("woff2");
}

@font-face {
    font-family: "Clash Grotesk";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/font/ClashGrotesk-Medium.woff2") format("woff2");
}

@font-face {
    font-family: "Clash Grotesk";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/font/ClashGrotesk-Bold.woff2") format("woff2");
}

/* ------------------------------------------------------------------ *
 * Tokens (palette + type, fixed per style-notes.md)
 * ------------------------------------------------------------------ */

:root {
    --bg: #F3EDC6;          /* page background */
    --weave: #EDE5BC;       /* weave lines, ~3% darker than the bg */
    --sheet: #F9F5CF;       /* content sheet */
    --ink: #000000;
    --terra: #C96F4A;       /* dates, hovers, sale banners */
    --maroon: #6B3239;      /* links, header bar, block headers, form button */
    --status-yellow: #D9A62E;
    --status-red: #BF3B2B;

    --mono: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Consolas, Menlo, monospace;
    --display: "Clash Display", sans-serif;
    --ui: "Clash Grotesk", sans-serif;

    /* the sheet's horizontal padding; block headers bleed out of it */
    --sheet-px: 24px;
}

/* ------------------------------------------------------------------ *
 * Base
 * ------------------------------------------------------------------ */

* {
    box-sizing: border-box;
}

html {
    /* reserve the scrollbar's space on every page so the centered
       sheet sits at the same x whether or not the page scrolls */
    scrollbar-gutter: stable;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    /* paper texture: barely-visible diagonal weave, 45deg, 8px period,
       1px lines. Should read as texture, not decoration. */
    background-color: var(--bg);
    background-image: repeating-linear-gradient(
        45deg,
        var(--weave) 0,
        var(--weave) 1px,
        transparent 1px,
        transparent 8px
    );
    /* the bottom gap lives as body padding, not sheet margin: a
       margin below the sheet collapses through the body edge and
       some browsers (Opera) leave that strip unpainted on long
       pages */
    padding-bottom: 20px;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.6;
}

::selection {
    background: var(--terra);
    color: var(--sheet);
}

a {
    color: var(--maroon);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--terra);
}

a:focus-visible {
    outline: 2px solid #000;
    outline-offset: 1px;
}

hr {
    border: none;
    border-top: 1px solid #000;
    margin: 16px 0;
}

ul,
ol {
    margin: 0;
    padding-left: 18px;
}

ul {
    list-style: disc;
}

li {
    margin-bottom: 4px;
}

/* ------------------------------------------------------------------ *
 * Page structure: full-width bars, one centered column, the sheet
 * ------------------------------------------------------------------ */

.column {
    max-width: 680px;
    margin: 0 auto;
    /* 25px so the header/nav text starts at the same x as the sheet
       body text (24px sheet padding + 1px sheet border); the column
       box matches the sheet box */
    padding-left: 25px;
    padding-right: 25px;
}

/* Header bar (all pages, identical) */

.site-header {
    background: var(--maroon);
}

.site-header .column {
    padding-top: 12px;
    padding-bottom: 12px;
}

.site-name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 30px;
    line-height: 1.2;
    color: var(--sheet);
}

.site-subline {
    font-size: 13px;
    color: var(--sheet);
}

/* early-web spinning disc after the site name: a little CD (cream
   disc, maroon hole, maroon label dot). The dot is off-center so
   the spin is visible. */

.site-name .disc {
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    margin-left: 10px;
    background: var(--sheet);
    border-radius: 50%;
    position: relative;
    vertical-align: -0.1em;
}

.site-name .disc-hole {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28%;
    height: 28%;
    background: var(--maroon);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.site-name .disc-dot {
    position: absolute;
    left: 50%;
    top: 12%;
    width: 16%;
    height: 16%;
    background: var(--maroon);
    border-radius: 50%;
    transform: translateX(-50%);
}

/* Nav strip (all pages, identical) */

.site-nav {
    background: var(--sheet);
    border-top: 1px solid var(--maroon);
    border-bottom: 1px solid var(--maroon);
}

.site-nav .column {
    padding-top: 10px;
    padding-bottom: 10px;
    font-family: var(--ui);
    font-size: 13px;
}

.site-nav .nav-active {
    font-weight: 700;
    color: var(--terra);
    text-decoration: none;
}

/* The sheet: the whole page body, one continuous block */

.sheet {
    max-width: 680px;
    margin: 20px auto 0;
    padding: 20px var(--sheet-px);
    background: var(--sheet);
    border: 1px solid var(--maroon);
    /* flex column so the spacing between segments is deterministic
       (no margin collapsing). The 20px top margin keeps the sheet
       detached from the nav (patterned background shows through).
       The bottom gap is body padding (see body above). */
    display: flex;
    flex-direction: column;
}

.sheet .block-body,
.sheet p,
.sheet ul,
.sheet ol,
.sheet table {
    margin: 0;
}

.sheet > * + * {
    margin-top: 12px;
}

/* inside a block: paragraph -> list, paragraph -> paragraph */
.sheet .block-body > * + * {
    margin-top: 12px;
}

/* a paragraph break is a real break: double-spaced */
.sheet .block-body p + p {
    margin-top: 20px;
}

/* line groups (edition lines, works lines, post lines) sit tighter
   than the general 12px segment gap */
.sheet > .edition-line + .edition-line,
.sheet > ol.tracklist + p.runtime {
    margin-top: 4px;
}

.sheet > .works-line + .works-line,
.sheet > .post-line + .post-line {
    margin-top: 6px;
}

/* runtime lines stack tight, one fact per line */
.sheet > .runtime + .runtime {
    margin-top: 4px;
}

/* Block header: the section header system, the only "banner".
   The bar bleeds out of the sheet's padding to the sheet's borders;
   its text is inset by the sheet padding, so it lines up with the
   body text below. */

.block-head {
    background: var(--maroon);
    color: var(--sheet);
    font-family: var(--display);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px var(--sheet-px);
    margin: 12px calc(-1 * var(--sheet-px)) 12px;
}

.sheet > .block-head:first-child {
    margin-top: 0;
}

.block-head.page-title {
    display: flex;
    align-items: center;
}

/* ------------------------------------------------------------------ *
 * Components
 * ------------------------------------------------------------------ */

/* Status bar (home, M&M section) */

.status-bar {
    border: 1px solid #000;
    padding: 8px 10px;
    width: fit-content;
    align-self: center;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.8;
}

/* the status bar gets a full line of air above and below */
.sheet > .status-bar,
.sheet > .status-bar + * {
    margin-top: 20px;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-square {
    width: 10px;
    height: 10px;
    flex: none;
}

.status-square.yellow {
    background: var(--status-yellow);
}

.status-square.red {
    background: var(--status-red);
}

/* Capabilities table (home, M&M section) */

.sheet .cap-key {
    font-size: 12px;
    margin: 4px 0 0;
}

.cap-wrap {
    overflow-x: auto;
}

table.capabilities {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.capabilities td {
    border: 1px solid #000;
    padding: 6px 8px;
}

table.capabilities td.cap-service {
    width: 60%;
}

table.capabilities td.cap-mark {
    width: 40%;
    text-align: center;
}

table.capabilities tr.cap-group td {
    border-top: 2px solid #000;
    background: var(--sheet);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Sale banners (album editions). The blink is the only animation on
   the site and lives inside the reduced-motion guard. */

.banner {
    display: inline-block;
    font-family: var(--ui);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    color: var(--sheet);
}

.banner.on-sale {
    background: var(--terra);
}

.banner.sold-out {
    background: #000;
}

.banner.pre-order {
    background: var(--maroon);
}

/* The old-GIF blink (0.5s on, 0.5s off) and the header disc spin are
   the only animation on the site, and both live inside the
   reduced-motion guard. */

@media (prefers-reduced-motion: no-preference) {
    .banner.on-sale,
    .rss-badge {
        animation: on-sale-blink 1s steps(1, end) infinite;
    }

    .site-name .disc {
        animation: disc-spin 2s linear infinite;
    }
}

@keyframes disc-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes on-sale-blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
    100% {
        opacity: 1;
    }
}

/* Edition line (album editions) */

.edition-line {
    font-size: 13px;
}

/* Post image (feed / yap post pages) */

figure.post-img {
    margin: 16px 0;
    text-align: center;
}

figure.post-img img {
    /* min(): the 480px cap on wide screens, but shrink to the
       column width on narrow viewports (a bare px cap overflows
       on mobile instead of shrinking) */
    max-width: min(480px, 100%);
    width: auto;
    height: auto;
    border: 1px solid #000;
}

figure.post-img figcaption {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--terra);
    text-align: center;
    margin-top: 6px;
}

/* optional attribution line under the caption (the image title);
   kept as written, one step smaller, maroon to separate it from
   the terracotta caption above it */
figure.post-img figcaption.fig-attr {
    font-size: 10px;
    text-transform: none;
    color: var(--maroon);
    margin-top: 4px;
}

/* RSS badge (feed page title bar) */

.rss-badge {
    margin-left: auto;
    /* flex-centered so the 9px text sits exactly on the box's middle
       line (asymmetric padding biased it upward) */
    display: inline-flex;
    align-items: center;
    height: 16px;
    padding: 0 6px;
    background: var(--sheet);
    color: var(--maroon);
    font-size: 9px;
    text-decoration: none;
}

/* Back links (.sheet p zeroes margins, so this needs the extra
   specificity) */

.sheet .back-link {
    margin-top: 12px;
    font-size: 12px;
}

/* Form fields (message box) */

.mb-face {
    width: 48px;
    height: 48px;
    align-self: center;
    border: 1px solid #000;
    object-fit: cover;
}

.msg-form {
    max-width: 480px;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg-field label {
    display: block;
    font-family: var(--ui);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--maroon);
    margin-bottom: 4px;
}

.msg-field input,
.msg-field textarea {
    width: 100%;
    border: 1px solid #000;
    border-radius: 0;
    background: #FFFFFF;
    padding: 6px 8px;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--ink);
}

.msg-field textarea {
    resize: vertical;
}

.msg-form button {
    align-self: flex-start;
    background: var(--maroon);
    color: var(--sheet);
    font-family: var(--ui);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 16px;
    border: 1px solid #000;
    border-radius: 0;
    cursor: pointer;
}

.msg-form button:hover {
    background: var(--terra);
}

.msg-form button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.msg-success {
    font-size: 14px;
}

/* The honeypot field: present for bots, invisible to everyone */

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ------------------------------------------------------------------ *
 * Page compositions
 * ------------------------------------------------------------------ *
 * Home: plain blocks, nothing extra.
 * ------------------------------------------------------------------ */

/* Works list */

.works-line {
    font-size: 14px;
}

/* Album pages */

.album-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.album-top .jacket {
    width: 200px;
    max-width: 100%;
    flex: none;
    border: 1px solid #000;
}

.album-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
    margin: 0;
}

.album-artist {
    font-size: 12px;
    margin: 2px 0 0;
}

.album-released {
    font-size: 12px;
    margin: 2px 0 0;
}

.blurb {
    font-size: 14px;
}

/* the blurb rides in the album-top column beside the jacket */
.album-id .blurb {
    margin-top: 10px;
}

/* Engineering credits (album page): one entry per event, two lines
   - the event + date at 13px (the channel / resolution spec, if
   any, rides on this line after a dot), the location(s) in tinier
   maroon below, dot-separated. No bullets, no box; the header
   divides the section. */

ul.engineering {
    font-size: 13px;
    list-style: none;
    padding-left: 0;
}

ul.engineering li {
    margin-bottom: 8px;
}

ul.engineering li:last-child {
    margin-bottom: 0;
}

.eng-main {
    display: block;
}

.eng-sub {
    display: block;
    font-size: 11px;
    color: var(--maroon);
    margin-top: 1px;
}

/* Face note: face icon left, note box right, notch pointing at the
   face. */

.face-note {
    display: flex;
    align-items: flex-start;
}

.face-icon {
    width: 48px;
    height: 48px;
    flex: none;
    border: 1px solid #000;
    object-fit: cover;
}

.face-box {
    position: relative;
    border: 1px solid #000;
    padding: 8px 10px;
    font-size: 13px;
    margin-left: 16px;
}

/* notes can run several paragraphs; a paragraph break is a real
   break: double-spaced (one blank line) between paragraphs */
.face-box p + p {
    margin-top: 20px;
}

/* notch: black triangle behind, sheet-colored triangle in front */

.face-box::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 14px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 10px solid #000;
}

.face-box::after {
    content: "";
    position: absolute;
    left: -9px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 9px solid var(--sheet);
}

/* Tracklist: CSS-counter numbers with a leading zero (01. - 09.),
   flush left, title directly after ("01. title") - no title column.
   The number is 4 chars in the mono font, so a 4ch hanging indent
   pushes wrapped continuation lines under the title. */
ol.tracklist {
    font-size: 13px;
    list-style: none;
    padding-left: 0;
    counter-reset: track;
}

ol.tracklist li {
    counter-increment: track;
    padding-left: 4ch;
    text-indent: -4ch;
}

ol.tracklist li::before {
    content: counter(track, decimal-leading-zero) ". ";
}

.runtime {
    font-size: 13px;
}

/* Feed / yap index pages */

.post-line {
    font-size: 14px;
}

.empty-state {
    font-size: 14px;
}

/* Picks (picks.html): a chronological list of annotated entries
   (PICKS + HONORABLE MENTIONS). No label column: each list is
   its own 1px solid maroon box (the sheet's frame color, square,
   no shadow, no fill) with 16px of horizontal air inside and 24px
   between the box edge and the first / last entry; the entries
   inside are divided by 1px solid maroon hairlines with 24px of
   air on each side of the rule (maroon, the sheet's own border
   color, is subtler than black), and each list sits 12px below
   the intro / caption (the site's normal segment spacing). The inside of an entry is kept tight
   (4px / 8px) against the wide 24px/24px lanes around each rule,
   so the entries read as compact blocks in wide lanes. Each
   entry, top to
   bottom: a record line at 14px mono black, "year - Artist -
   Title" with a middot between every element (the year first,
   then the artist, then the album; no dashes), ending in an
   explicit badge when the record carries one (a real badge,
   but in the site's quiet box language: 1px solid black, no
   fill, black small-caps text, square, centered on the caps of
   the record line); a sub-line at
   11px maroon with the nominated category as a
   small-caps tag, 10px Clash Grotesk uppercase, letter-spacing
   0.08em, #C96F4A, then a middot and the key track (honorable
   mentions carry the key track alone, no tag); credit lines (11px
   maroon, one per line) once the owner adds names, matching the
   nominated category only (Mix -> mixing engineer, Production ->
   producer, Production & Mix -> both, no other credits); and the
   owner's note at 13px black (one size below the record line,
   same color, so the comment stays quiet and the record line
   holds the eye). Same layout at every width. Note: .sheet p
   zeroes margins at higher specificity, so the intra-entry
   spacing uses two-class selectors. */

.pick-intro {
    font-size: 14px;
}

.pick-caption {
    font-size: 12px;
    color: var(--maroon);
}

ul.pick-list {
    list-style: none;
    /* normal site segment spacing (the 12px between sheet
       segments) between the intro / caption and the box */
    margin: 12px 0 0;
    /* the list is its own 1px solid maroon box (the sheet's frame
       color, square, no shadow, no fill); 16px of horizontal air
       inside, 24px between the box edge and the first / last
       entry */
    padding: 0 16px 24px;
    border: 1px solid var(--maroon);
}

ul.pick-list li {
    /* 24px of air below the box edge (first entry) or the hairline */
    padding-top: 24px;
}

ul.pick-list li + li {
    /* the hairline between entries: 24px of air above the rule */
    margin-top: 24px;
    border-top: 1px solid var(--maroon);
}

/* Record line: "1978 · Kazumi Watanabe - Lonesome Cat" at body
   size, black - the entry's data. */
.pick .pick-line {
    font-size: 14px;
    margin: 0;
}

/* Sub-line: category tag (main list only) + key track, 11px
   maroon, tight under the record line. */
.pick .pick-sub {
    font-size: 11px;
    color: var(--maroon);
    margin: 4px 0 0;
}

/* The nominated category: a small-caps terracotta label on the
   sub-line (main list only). */
.pick-role {
    margin: 0;
    font-family: var(--ui);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--terra);
}

/* Explicit-lyrics badge at the end of the record line: a real
   badge, not text, but in the site's quiet box language (1px
   solid black, no fill - like the status bar / tables) so it
   marks the record without shouting. Small-caps, square (the
   site has no rounded corners). vertical-align is an explicit
   2px raise off the baseline so the box centers on the caps of
   the 14px mono text (vertical-align: middle lands below the
   optical center); the offset is absolute, so it holds across
   the mono stack (Consolas / Cascadia / SF Mono). */
.pick .pick-explicit {
    display: inline-block;
    border: 1px solid var(--ink);
    color: var(--ink);
    font-family: var(--ui);
    font-size: 10px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1px 5px;
    margin-left: 8px;
    vertical-align: 2px;
}

/* Credit lines (once the owner adds names), one per line, 11px
   maroon. */
.pick .pick-meta {
    font-size: 11px;
    color: var(--maroon);
    margin: 2px 0 0;
}

/* The owner's note: one size below the record line, same color -
   the comment stays quiet and the record line holds the eye. */
.pick .pick-note {
    font-size: 13px;
    color: var(--ink);
    margin: 8px 0 0;
}

/* Post pages */

.post-date {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--terra);
}

.post-body {
    font-size: 14px;
}

/* post body: the same rhythm as the other block bodies */
.sheet .post-body > * + * {
    margin-top: 12px;
}

.sheet .post-body p + p {
    margin-top: 20px;
}

/* the figure keeps its own air (the rule above outranks its
   shorthand, so it is restated here) */
.sheet .post-body > figure.post-img {
    margin: 16px 0;
}

/* Quote box (post pages): the attribution in a maroon header, the
   words in the box below it */

.quote-box {
    border: 1px solid #000;
}

.quote-head {
    background: var(--maroon);
    color: var(--sheet);
    font-family: var(--display);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
}

.quote-body {
    padding: 10px 12px;
}

.quote-body p + p {
    margin-top: 20px;
}

/* 404 */

.not-found {
    font-size: 14px;
}

/* ------------------------------------------------------------------ *
 * Mobile (<640px)
 * ------------------------------------------------------------------ */

@media (max-width: 639px) {
    /* match the sheet body text inset: 12px gutter + 1px border +
       16px sheet padding */
    .column {
        padding-left: 29px;
        padding-right: 29px;
    }

    /* 12px gutters, 16px sheet padding */
    .sheet {
        max-width: none;
        margin-left: 12px;
        margin-right: 12px;
        --sheet-px: 16px;
        padding: var(--sheet-px);
    }

    .site-name {
        font-size: 24px;
    }

    /* nav wraps to as many lines as needed */
    .site-nav .column {
        word-break: break-word;
    }

    /* jacket first, text below it */
    .album-top {
        flex-direction: column;
    }

    .album-top .jacket {
        max-width: 200px;
    }

    table.capabilities {
        font-size: 12px;
    }
}
