/* dvd.club — film-strip identity: a disc + film-negative sprocket strips.
   Palette is ink on aged paper; the red accent is the only saturated ink.
   (The amber of the film strip is stock, a material, not an accent.) */

:root {
    --paper:      #F2E8D0; /* page ground */
    --surface:    #FCFBF8; /* raised near-white: inputs, panels */
    --header:     #8FAAA6; /* dusty teal header band — orange-and-teal with the strips */
    --ink:        #1C1815; /* text */
    --muted:      #6A5F50; /* secondary / utility text */
    --header-ink: #22403B; /* secondary text on the teal header */
    --accent:     #A83E2E; /* the one accent — rules, active/hover */
    --focus:      #2E4B6B; /* neutral focus ring on form fields */

    --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --mono:  "Courier New", ui-monospace, "SFMono-Regular", monospace;
    --display: "Gill Sans", "Gill Sans MT", Futura, "Century Gothic", "Trebuchet MS", system-ui, sans-serif;

    /* Kodak Vision3 camera negative, as film *material* (not an accent — the red stays
       the one ink accent). Two layers: BH negative perforations (portrait: taller than
       wide, on a horizontal strip) on an orange-mask base, plus a faint keykode edge-print.
       --film-perf tiles at 20px (~4-perf pitch); --film-keykode repeats ~every foot. */
    --film-mask: #C56526;
    --film-perf: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='30'%3E%3Crect%20width='20'%20height='30'%20fill='%23C56526'/%3E%3Crect%20x='6'%20y='4'%20width='8'%20height='12'%20rx='1.5'%20fill='%23F2E8D0'/%3E%3C/svg%3E");
    --film-keykode: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='250'%20height='30'%3E%3Ctext%20x='6'%20y='27'%20font-family='monospace'%20font-size='7'%20letter-spacing='.4'%20fill='%23F2E8D0'%20fill-opacity='.55'%3EKODAK%20VISION3%20500T%205219%3C/text%3E%3Cg%20fill='%23F2E8D0'%20fill-opacity='.5'%3E%3Crect%20x='156'%20y='22'%20width='1.6'%20height='6'/%3E%3Crect%20x='160'%20y='22'%20width='1'%20height='6'/%3E%3Crect%20x='163'%20y='22'%20width='2.4'%20height='6'/%3E%3Crect%20x='168'%20y='22'%20width='1'%20height='6'/%3E%3Crect%20x='171'%20y='22'%20width='1.6'%20height='6'/%3E%3Crect%20x='175'%20y='22'%20width='1'%20height='6'/%3E%3Crect%20x='178'%20y='22'%20width='2.4'%20height='6'/%3E%3Crect%20x='183'%20y='22'%20width='1'%20height='6'/%3E%3C/g%3E%3C/svg%3E");

    --page-max: 1220px;
    --gutter:   22px;
    --tile-min: 150px;
    --grid-gap: 15px;
}

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

/* headings share the display (humanist sans) with the wordmark & nav;
   body copy stays serif for reading, utility labels stay mono */
h1, h2, h3 { font-family: var(--display); }

/* --- accessibility utilities --- */
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 10;
    background: var(--surface); color: var(--ink);
    padding: 8px 14px; border-radius: 3px;
    font-family: var(--mono); font-size: 13px; text-decoration: none;
    transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 1px;
}

/* ============================================================
   Masthead — film-negative sprocket strips framing a disc + wordmark.
   The amber strip is film stock (a material, like the paper), not an
   accent; the two-ring disc and wordmark are plain ink.
   ============================================================ */
.masthead {
    background: var(--header);
    position: relative; z-index: 1;
    box-shadow: 0 5px 18px -10px rgba(28, 24, 21, .4);
}

/* a strip of film negative: keykode edge-print over the perforated orange-mask base.
   The bottom strip mirrors the perfs to its outer edge, so the header reads as one frame
   held between two perforated edges. */
.filmstrip {
    height: 30px;
    background: var(--film-keykode) repeat-x, var(--film-perf) repeat-x;
    background-size: 250px 30px, 20px 30px;
}
.filmstrip.bottom {
    background: var(--film-perf) repeat-x;
    background-size: 20px 30px;
    transform: scaleY(-1);
}

.masthead-inner {
    max-width: var(--page-max); margin: 0 auto;
    padding: 14px var(--gutter);
    display: flex; flex-direction: column; gap: 8px;
}
/* row 1: disc + wordmark + tagline (left) — nav (right) */
.masthead-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.masthead-top .tagline { padding-top: 4px; } /* sit against the wordmark's baseline */
.masthead-top .links { margin-left: auto; }
/* row 2: the catalogue search, given room of its own */
.masthead-sub { display: block; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }

/* the disc: two concentric rings, same stroke, no fill */
.disc {
    width: 46px; height: 46px; flex: 0 0 auto;
    border: 2px solid var(--ink); border-radius: 50%; position: relative;
}
.disc::before {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 14px; height: 14px;
    border: 2px solid var(--ink); border-radius: 50%;
}

.wm {
    font-family: var(--display); font-weight: 700;
    font-size: clamp(30px, 5.5vw, 46px); letter-spacing: -.02em; line-height: .9;
    color: var(--ink);
}
.wm .dot { color: var(--accent); }

.tagline { margin: 0; font-size: 14px; color: var(--header-ink); font-style: italic; }

/* search: understated felt-tip underline field, given a comfortable width on its own row */
.search { display: block; }
.search form { margin: 0; }
.search input {
    appearance: none;
    background: transparent;
    border: 0; border-bottom: 1.5px solid rgba(46, 75, 107, .4);
    padding: 5px 2px; width: min(360px, 100%);
    font-family: var(--mono); font-size: 13px; color: var(--ink);
    transition: border-color .15s ease;
}
.search input::placeholder { color: var(--header-ink); opacity: 1; }
.search input:focus { outline: none; border-bottom-color: var(--accent); }
.search input:focus-visible { outline: none; } /* underline is the focus signal here */

.links {
    display: flex; align-items: center; flex-wrap: wrap; gap: 20px;
    font-family: var(--display); font-size: 12.5px;
    letter-spacing: .12em; text-transform: uppercase;
}
.links a {
    text-decoration: none; color: var(--header-ink);
    padding-bottom: 2px; border-bottom: 1.5px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.links a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.links a.on { color: var(--ink); border-bottom-color: var(--accent); }
.links .sep { color: var(--header-ink); opacity: .45; }

/* Requests count badge */
.badge {
    display: inline-block; min-width: 1.5em; padding: 0 .35em;
    background: var(--accent); color: var(--surface);
    border-radius: 2px; font-size: .85em; text-align: center;
}

/* Log out sits in the nav row as plain utility type, not a chunky button */
.logout { display: inline; margin: 0; }
.logout button {
    appearance: none; background: none; border: 0; cursor: pointer;
    padding: 0 0 2px; border-bottom: 1.5px solid transparent;
    font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--header-ink);
    transition: color .15s ease, border-color .15s ease;
}
.logout button:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ============================================================
   The shelf — the poster wall is the hero
   ============================================================ */
main { min-height: 60vh; }
.shelf-wrap { max-width: var(--page-max); margin: 0 auto; padding: 34px var(--gutter) 80px; }

.shelfbar { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 18px; }
.shelfbar h1 { margin: 0; font-weight: 600; font-size: 21px; letter-spacing: .3px; }
.count { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }

.poster-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr));
    gap: var(--grid-gap);
}
.tile a {
    display: flex; flex-direction: column; gap: 7px;
    text-decoration: none; color: inherit;
}
/* uniform 2:3 tile; posters vary in ratio, so cover-crop to keep the grid true */
.poster {
    display: block; aspect-ratio: 2 / 3; overflow: hidden;
    background: #d8cbaf;
    border: 1px solid rgba(28, 24, 21, .12); border-radius: 2px;
    box-shadow: 0 6px 16px -14px rgba(28, 24, 21, .7);
    transition: transform .15s ease, box-shadow .15s ease;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile a:hover .poster {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -12px rgba(28, 24, 21, .75);
}
.caption {
    font-family: var(--mono); font-size: 11px; line-height: 1.35; color: var(--ink);
}
.caption .year { color: var(--muted); }

.empty {
    max-width: 46ch; margin: 40px auto; text-align: center;
    color: var(--muted); font-style: italic;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
    max-width: var(--page-max); margin: 0 auto;
    padding: 24px var(--gutter) 40px;
    border-top: 1px solid rgba(28, 24, 21, .12);
    font-family: var(--mono); font-size: 12px; color: var(--muted);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
footer p { margin: 0; }
.foot-links { margin: 0 0 8px; }
.foot-links a[aria-current="page"] { color: var(--ink); }

/* ============================================================
   Title page — clean and legible; identity carried by palette + type
   ============================================================ */
.title-page {
    max-width: var(--page-max); margin: 0 auto; padding: 34px var(--gutter) 80px;
    display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 40px;
    align-items: start;
}

/* poster shown whole, at its true ratio (no crop, unlike the browse grid) */
.title-sleeve {
    margin: 0; overflow: hidden;
    background: #d8cbaf;
    border: 1px solid rgba(28, 24, 21, .15); border-radius: 2px;
    box-shadow: 0 10px 24px -16px rgba(28, 24, 21, .75);
}
.title-sleeve img { display: block; width: 100%; height: auto; }

.title-head { margin: 0 0 28px; }
.title-head h1 { margin: 0; font-size: clamp(26px, 4vw, 36px); font-weight: 600; line-height: 1.12; }
.title-head .year { color: var(--muted); font-weight: 400; }

.copies-section h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }

.table-wrap { overflow-x: auto; }

.copies { width: auto; border-collapse: collapse; }
.copies th {
    text-align: left; padding: 10px 16px 8px 0; font-weight: 400;
    font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
    border-bottom: 1px solid rgba(28, 24, 21, .2);
}
.copies td {
    padding: 14px 16px 14px 0; vertical-align: middle; font-size: 15px;
    border-bottom: 1px solid rgba(28, 24, 21, .1);
}
.copies tbody tr:last-child td { border-bottom: 0; }
.copies th:last-child, .copies .action { padding-right: 0; padding-left: 28px; }
.copies .fmt { white-space: nowrap; }
.copies .edition { color: var(--muted); }
.copies .owner { white-space: nowrap; }
.copies .owner .cc { color: var(--muted); }
.copies .owner .flag { font-size: 1.15em; vertical-align: -1px; }

/* primary action: understated outline that inks in on hover — no red fill, no gimmick */
/* Buttons look pressable — fill + a little depth, and they press down on :active — so a
   control is never mistaken for a status label (flat) or a link (underlined). Primary is
   solid ink; secondary is a light fill (neutral hover); add .danger for destructive
   actions, which hover the accent. */
.btn {
    display: inline-block; cursor: pointer; white-space: nowrap;
    font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--paper); background: var(--ink);
    border: 1px solid var(--ink); border-radius: 3px; padding: 8px 16px; text-decoration: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 2px 4px -2px rgba(28, 24, 21, .5);
    transition: background .12s ease, box-shadow .1s ease, transform .08s ease;
}
.btn:hover { background: #2b241d; }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px -1px rgba(28, 24, 21, .45); }
.copies .action form { margin: 0; }

.btn-quiet {
    display: inline-block; cursor: pointer; white-space: nowrap;
    font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--ink); background: var(--surface);
    border: 1px solid rgba(28, 24, 21, .28); border-radius: 3px; padding: 8px 16px;
    box-shadow: 0 1px 2px -1px rgba(28, 24, 21, .28);
    transition: color .12s ease, border-color .12s ease, box-shadow .1s ease, transform .08s ease;
}
.btn-quiet:hover { border-color: rgba(28, 24, 21, .5); }
.btn-quiet:active { transform: translateY(1px); box-shadow: none; }
.btn-quiet.danger:hover { color: var(--accent); border-color: var(--accent); }

/* title link inside a copies table */
.copies .link { color: var(--ink); text-decoration: none; }
.copies .link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.state { color: var(--muted); font-size: 13px; }
.state-link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.state-link:hover { color: var(--accent); }

.no-copies { margin: 12px 0 0; color: var(--muted); }

.lend-row { margin: 26px 0 0; }
.lend-row a { font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.lend-row a:hover { color: var(--accent); }

@media (max-width: 640px) {
    .title-page { grid-template-columns: 1fr; gap: 22px; }
    .title-sleeve { max-width: 240px; }
}

/* ============================================================
   Requests — the lending / borrowing action queue
   ============================================================ */
.requests-group { margin: 30px 0 0; max-width: 820px; }
.requests-group > h2 {
    margin: 0 0 6px; padding-bottom: 6px;
    font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
    font-weight: 400; color: var(--muted);
    border-bottom: 1px solid rgba(28, 24, 21, .18);
}
.requests-list { list-style: none; margin: 0; padding: 0; }
.request { padding: 16px 0; border-bottom: 1px solid rgba(28, 24, 21, .1); }
.request:last-child { border-bottom: 0; }
.request-main { min-width: 0; }
.request-title { font-size: 16px; }
.request-meta { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }
/* actions on their own line under the title/meta — consistent no matter how many a row has,
   instead of wrapping unpredictably when one row carries an extra button */
.request-side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
/* status is read-only: flat text + an indicator dot, never a box — so it can't read as a
   button (filled/raised) or a link (underlined) */
.status {
    font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
    white-space: nowrap;
}
.status::before {
    content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px;
    border-radius: 50%; background: var(--muted); opacity: .7; vertical-align: 1px;
}
.request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.request-form { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   Forms — lend, auth, profile (scoped to .form so it can't touch header search etc.)
   ============================================================ */
.form-page { max-width: var(--page-max); margin: 0 auto; padding: 34px var(--gutter) 80px; }
.form-title { margin: 0 0 24px; font-size: clamp(22px, 3.5vw, 30px); font-weight: 600; line-height: 1.15; }
.form-title .year { color: var(--muted); font-weight: 400; }

.form { max-width: 460px; }
.form .field { margin: 0 0 18px; }
.field-label {
    display: block; margin: 0 0 6px;
    font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form select, .form textarea {
    width: 100%; font-family: var(--serif); font-size: 15px; color: var(--ink);
    background: var(--surface); border: 1px solid rgba(28, 24, 21, .25); border-radius: 3px; padding: 9px 11px;
    transition: border-color .12s ease;
}
.form textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field-static { margin: 0; font-family: var(--serif); font-size: 15px; color: var(--ink); }
.form input::placeholder, .form textarea::placeholder { color: var(--muted); }
/* neutral focus ring — red here would read as a validation error */
.form input:focus, .form select:focus, .form textarea:focus {
    border-color: var(--focus); outline: none;
    box-shadow: 0 0 0 3px rgba(46, 75, 107, .15);
}
.form select:invalid { color: var(--muted); } /* placeholder shows muted until a format is picked */

.form-note { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }

.form .check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 22px; }
.form .check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); }
.form .check label { font-size: 14px; color: var(--ink); }

.form-lead { max-width: 60ch; margin: 0 0 24px; }

/* form error — accent as ink, not a fill */
.alert {
    max-width: 460px; margin: 0 0 20px; padding: 10px 14px;
    border-left: 3px solid var(--accent); background: rgba(168, 62, 46, .09);
    color: var(--ink); font-size: 14px;
}

/* address group: strip the boxy fieldset chrome; legend becomes a subheading */
.form fieldset { border: 0; padding: 0; margin: 26px 0 0; }
.form legend { padding: 0; margin: 0 0 4px; font-family: var(--serif); font-size: 16px; font-weight: 600; }

/* simple text pages (invite-only, success, messages) */
.prose { max-width: var(--page-max); margin: 0 auto; padding: 40px var(--gutter) 80px; }
.prose h1 { margin: 0 0 14px; font-size: clamp(24px, 3.5vw, 32px); font-weight: 600; line-height: 1.15; }
.prose h2 { margin: 34px 0 8px; font-size: 20px; font-weight: 600; }
.prose h3 { margin: 22px 0 4px; font-size: 16px; font-weight: 600; }
.prose p { max-width: 62ch; margin: 0 0 14px; }
.prose ul { max-width: 62ch; margin: 0 0 16px; padding-left: 1.2em; }
.prose li { margin: 0 0 4px; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }

/* invite link — a click-to-select code block (whole URL selects on click; no JS) */
.invites, .password { max-width: 460px; margin: 40px 0 0; padding-top: 26px; border-top: 1px solid rgba(28, 24, 21, .12); }
.invites h2, .password h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.password h2 { margin-bottom: 14px; }
.invite-link { margin: 0; }
.invite-link code {
    display: block; user-select: all;
    font-family: var(--mono); font-size: 13px; color: var(--ink);
    background: var(--surface); border: 1px solid rgba(28, 24, 21, .22); border-radius: 3px;
    padding: 10px 12px; overflow-wrap: anywhere;
}
.copy-link { margin-top: 12px; }

/* postal address — a clean mailing-label block: centered like a printed label */
.postal {
    max-width: 420px; margin: 6px 0 0; font-style: normal; text-align: center;
    font-family: var(--mono); font-size: 15px; line-height: 1.7; color: var(--ink);
    background: var(--surface); border: 1px solid rgba(28, 24, 21, .22); border-radius: 3px;
    padding: 18px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
    /* smaller tiles so phones show two posters to a row, not one column */
    :root { --gutter: 16px; --tile-min: 130px; --grid-gap: 12px; }
    .shelf-wrap { padding-top: 24px; padding-bottom: 56px; }
    .form-page, .prose { padding-top: 26px; padding-bottom: 56px; }
}

@media (max-width: 620px) {
    .search input { width: 100%; }
    .masthead-top { row-gap: 10px; }
    .links { flex-basis: 100%; margin-left: 0; gap: 12px 16px; }
    .masthead-top .tagline { flex-basis: 100%; padding-top: 0; }
}

@media (max-width: 480px) {
    .masthead-top .tagline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
