/* THE WRECK LIBRARY — The Wreck Explorer.
   The archive reading room as a pinned, scroll-driven, multi-layer parallax
   scene (the desk lamp comes on), a bridge with the archive in numbers, and
   the library: search, filters, a spotlight Gallery and a List.
   In keeping with www.wreckexplorer.co.uk: warm paper, dark ink, rust,
   Manrope with heavy, tightly tracked headings, pill buttons.
   Every rule is scoped under .wx-library. */

.wx-library {
  --wxl-paper: #f0efe8;
  --wxl-paper-2: #f7f6f1;
  --wxl-ink: #152021;
  --wxl-ink-2: #26332e;
  --wxl-ink-dim: rgb(21 32 33 / .64);
  --wxl-line: rgb(21 32 33 / .16);
  --wxl-rust: #b83c1e;
  --wxl-rust-text: #a63920;
  --wxl-pine: #1e3a26;
  --wxl-room: #0d1a17;
  --wxl-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wxl-gutter: 16px;
  --wxl-edge: 5vw;
  position: relative;
  overflow-x: clip;
  background: var(--wxl-paper);
  color: var(--wxl-ink);
  font-family: var(--wxl-sans);
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 640px) { .wx-library { --wxl-gutter: 24px; } }
.wx-library *, .wx-library *::before, .wx-library *::after { box-sizing: border-box; }
.wx-library :is(h1, h2, h3, p, ol, ul, dl, dd, dt) { margin: 0; padding: 0; }
.wx-library :is(ol, ul) { list-style: none; }
.wx-library a { color: inherit; text-decoration: none; }
.wx-library img { display: block; max-width: none; }
.wx-library button, .wx-library input, .wx-library select { font: inherit; color: inherit; }
.wx-library .wxl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ Type */
.wx-library .wxl-kicker { font: 700 .6875rem/1.3 var(--wxl-sans); letter-spacing: .2em; text-transform: uppercase; }
.wx-library .wxl-rust { color: var(--wxl-rust-text); }
.wx-library .wxl-display { font: 650 clamp(2.5rem, 7vw, 6rem)/.98 var(--wxl-sans); letter-spacing: -.045em; color: var(--wxl-ink); }
.wx-library .wxl-lede { max-width: 40rem; font-size: clamp(1rem, 1.2vw, 1.125rem); line-height: 1.6; color: var(--wxl-ink-2); }
.wx-library .wxl-bob { display: inline-block; animation: wxl-bob 1s infinite; }
@keyframes wxl-bob {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); }
  50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); }
}

/* ------------------------------------------------------------ 1. The scene */
.wx-library .wxl-scene { position: relative; height: 460svh; }
.wx-library .wxl-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--wxl-room); }
.wx-library .wxl-layer { position: absolute; inset: 0; will-change: transform; }
/* All layers share one crop, so they stay registered at every screen shape. */
.wx-library .wxl-fit { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; }
/* The lamp's light is added on top of the room. */
.wx-library .wxl-light { mix-blend-mode: screen; opacity: 0; }
@supports (mix-blend-mode: plus-lighter) { .wx-library .wxl-light { mix-blend-mode: plus-lighter; } }
.wx-library .wxl-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.wx-library .wxl-title { position: absolute; left: 0; right: 0; top: 15%; padding: 0 var(--wxl-gutter); text-align: center; pointer-events: none; color: #fff; }
.wx-library .wxl-title .wxl-kicker { color: #ef8a6a; }
.wx-library .wxl-title h1 { margin-top: 14px; font: 650 clamp(2.5rem, 8.4vw, 8.5rem)/.95 var(--wxl-sans); letter-spacing: -.045em; text-shadow: 0 6px 50px rgb(0 0 0 / .55); }

.wx-library .wxl-veil { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 70% at 50% 45%, rgba(20, 34, 30, .86), rgba(8, 14, 12, .97)); }
.wx-library .wxl-veil-copy { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); padding: 0 var(--wxl-gutter); text-align: center; color: rgb(240 239 232 / .82); }
.wx-library .wxl-veil-copy .wxl-kicker { color: #ef8a6a; }
.wx-library .wxl-cue { margin: 14px -.3em 0 0; font: 600 .8125rem/1.4 var(--wxl-sans); letter-spacing: .3em; text-transform: uppercase; color: #fff; }
@media (min-width: 640px) { .wx-library .wxl-cue { margin-right: -.45em; letter-spacing: .45em; } }
.wx-library .wxl-veil-copy .wxl-bob { margin-top: 24px; }

.wx-library .wxl-hud { position: absolute; inset: 18px var(--wxl-gutter); pointer-events: none; font: 600 .625rem/1.3 var(--wxl-sans); letter-spacing: .16em; text-transform: uppercase; color: rgb(240 239 232 / .72); }
@media (min-width: 768px) { .wx-library .wxl-hud { inset: 24px var(--wxl-edge); font-size: .6875rem; } }
.wx-library .wxl-hud-tl, .wx-library .wxl-hud-tr { position: absolute; top: 56px; }
.wx-library .wxl-hud-tl { left: 0; }
.wx-library .wxl-hud-tr { right: 0; }
.wx-library .wxl-hud-tr span { color: #ef8a6a; }
.wx-library .wxl-hud-bl { position: absolute; left: 0; bottom: 0; max-width: 62%; }
.wx-library .wxl-hud-br { position: absolute; right: 0; bottom: 0; display: flex; gap: 8px; }
.wx-library .wxl-fade { position: absolute; inset: 0; background: var(--wxl-paper); opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------ 2. The bridge */
.wx-library .wxl-bridge { position: relative; height: 200svh; background: var(--wxl-paper); }
/* It glides up over the last screen of the scene as the room fades to paper. */
.wx-library .wxl-scene + .wxl-bridge { margin-top: -100svh; }
.wx-library .wxl-bridge-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; align-content: center; gap: clamp(36px, 7vh, 72px); padding: 72px var(--wxl-gutter) 40px; background: var(--wxl-paper); }
@media (min-width: 768px) { .wx-library .wxl-bridge-stage { padding: 96px var(--wxl-edge) 56px; } }
.wx-library .wxl-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; border-top: 1px solid var(--wxl-line); padding-top: 18px; }
@media (min-width: 900px) { .wx-library .wxl-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wx-library .wxl-stats dt { font: 700 .6875rem/1.3 var(--wxl-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--wxl-rust-text); }
.wx-library .wxl-stats dd { margin-top: 6px; font: 650 clamp(2.25rem, 5.4vw, 4.75rem)/1 var(--wxl-sans); letter-spacing: -.05em; font-variant-numeric: tabular-nums; color: var(--wxl-ink); }
.wx-library .wxl-words { max-width: 22ch; font: 650 clamp(1.75rem, 4.4vw, 3.75rem)/1.06 var(--wxl-sans); letter-spacing: -.04em; }
@media (min-width: 768px) { .wx-library .wxl-words { max-width: 26ch; } }
.wx-library .wxl-words span { color: rgb(21 32 33 / .14); transition: color .35s ease; }
.wx-library .wxl-words span.is-lit { color: var(--wxl-ink); }
.wx-library .wxl-words span.is-key.is-lit { color: var(--wxl-rust); }

/* ------------------------------------------------------------ 3. The library */
.wx-library .wxl-library { padding: 112px var(--wxl-gutter) 120px; }
@media (min-width: 768px) { .wx-library .wxl-library { padding: 150px var(--wxl-edge) 160px; } }
.wx-library .wxl-library .wxl-display { margin-top: 18px; }
.wx-library .wxl-library .wxl-lede { margin-top: 22px; }

/* Filters: underlined fields and a round reset, as on the live site. */
.wx-library .wxl-filters { margin-top: 56px; display: grid; gap: 18px; align-items: end; }
@media (min-width: 640px) { .wx-library .wxl-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .wx-library .wxl-filters { grid-template-columns: minmax(0, 2.2fr) repeat(5, minmax(0, 1fr)) auto; gap: 14px; } }
.wx-library .wxl-field { display: grid; gap: 8px; min-width: 0; }
.wx-library .wxl-field > span { font-size: .75rem; color: var(--wxl-ink-dim); }
.wx-library .wxl-field :is(input, select) { width: 100%; min-width: 0; height: 46px; padding: 0 28px 0 4px; border: 0; border-bottom: 1px solid rgb(21 32 33 / .35); border-radius: 0; background: transparent; font-size: .9375rem; color: var(--wxl-ink); -webkit-appearance: none; appearance: none; }
.wx-library .wxl-field select { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23152021' stroke-width='1.6'/%3E%3C/svg%3E") right 6px center no-repeat; }
.wx-library .wxl-field :is(input, select):focus { outline: none; border-bottom-color: var(--wxl-rust); box-shadow: 0 1px 0 var(--wxl-rust); }
.wx-library .wxl-field input::placeholder { color: rgb(21 32 33 / .45); }
@media (min-width: 640px) and (max-width: 1099px) { .wx-library .wxl-search { grid-column: 1 / -1; } }
.wx-library .wxl-reset { justify-self: start; height: 46px; padding: 0 20px; border: 1px solid rgb(21 32 33 / .35); border-radius: 100px; background: transparent; font-size: .8125rem; cursor: pointer; transition: background-color .2s, color .2s; }
.wx-library .wxl-reset:hover { background: var(--wxl-ink); color: var(--wxl-paper); }
.wx-library :focus-visible { outline: 2px solid var(--wxl-rust); outline-offset: 3px; }

.wx-library .wxl-results-bar { margin-top: 32px; padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--wxl-line); border-bottom: 1px solid var(--wxl-line); }
.wx-library .wxl-results-bar p { font-size: .875rem; }
.wx-library .wxl-views { display: flex; gap: 8px; }
.wx-library .wxl-views button { height: 38px; padding: 0 18px; border: 1px solid rgb(21 32 33 / .3); border-radius: 100px; background: transparent; font-size: .8125rem; cursor: pointer; }
.wx-library .wxl-views button[aria-pressed="true"] { background: var(--wxl-pine); border-color: var(--wxl-pine); color: #fff; }

/* Gallery: a spotlight carousel on paper. Framed pictures shingle into a
   rail; the middle one opens out (re-cropping, never stretching) to carry
   its caption; a soft glow of it spreads behind. No box, no arrows. */
.wx-library .wxl-spot { position: relative; isolation: isolate; margin: 24px calc(var(--wxl-gutter) * -1) 0; }
@media (min-width: 768px) { .wx-library .wxl-spot { margin-inline: calc(var(--wxl-edge) * -1); } }
.wx-library .wxl-spot[hidden] { display: none; }
.wx-library .wxl-spot-glow { position: absolute; left: 50%; top: 46%; width: min(1000px, 150vw); height: 120%; transform: translate(-50%, -50%); z-index: -1; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 100%); mask-image: radial-gradient(closest-side, #000 30%, transparent 100%); }
.wx-library .wxl-spot-glow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(60px) saturate(1.3); opacity: 0; transition: opacity .9s ease; }
.wx-library .wxl-spot-glow img.is-on { opacity: .42; }
.wx-library .wxl-spot-stage { position: relative; height: clamp(420px, 60vh, 540px); margin: 20px 0 10px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.wx-library .wxl-spot-stage:active { cursor: grabbing; }
.wx-library .wxl-card { --dim: 0; position: absolute; left: 50%; top: 50%; display: block; -webkit-tap-highlight-color: transparent;
  transition: width .6s cubic-bezier(.2, .7, .1, 1), height .6s cubic-bezier(.2, .7, .1, 1), transform .6s cubic-bezier(.2, .7, .1, 1), opacity .4s; }
/* The mount: a paper frame around the picture. */
.wx-library .wxl-frame { position: absolute; inset: 0; overflow: hidden; border-radius: 10px; padding: 6px; background: #fbfaf6; box-shadow: 0 0 0 1px rgb(21 32 33 / .1), 0 22px 50px -26px rgb(21 32 33 / .55); }
.wx-library .wxl-card.is-active .wxl-frame { box-shadow: 0 0 0 1px rgb(21 32 33 / .14), 0 40px 90px -36px rgb(21 32 33 / .7); }
.wx-library .wxl-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; background: #ddd8cb; }
.wx-library .wxl-frame::after { content: ""; position: absolute; inset: 6px; border-radius: 6px; background: var(--wxl-paper); opacity: var(--dim); transition: opacity .5s; pointer-events: none; }
.wx-library .wxl-shade { position: absolute; inset: 6px; border-radius: 6px; background: linear-gradient(180deg, rgb(10 16 14 / .15), rgb(10 16 14 / 0) 40%, rgb(10 16 14 / .88)); opacity: 0; transition: opacity .5s; }
.wx-library .wxl-card.is-active .wxl-shade { opacity: 1; }
/* With no picture on record, the card is honest about it. */
.wx-library .wxl-blank { position: absolute; inset: 6px; display: grid; place-content: center; gap: 6px; border-radius: 6px; text-align: center; background: repeating-linear-gradient(135deg, #e7e2d6 0 10px, #ece8dd 10px 20px); color: rgb(21 32 33 / .55); }
.wx-library .wxl-blank b { font: 650 clamp(2.5rem, 5vw, 3.5rem)/1 var(--wxl-sans); letter-spacing: -.05em; color: rgb(21 32 33 / .35); }
.wx-library .wxl-blank small { font: 700 .625rem/1.3 var(--wxl-sans); letter-spacing: .18em; text-transform: uppercase; }
.wx-library .wxl-card.is-active .wxl-blank b { color: rgb(21 32 33 / .2); }
.wx-library .wxl-kind { position: absolute; top: 16px; left: 16px; max-width: calc(100% - 32px); padding: 4px 8px; border-radius: 100px; background: rgb(251 250 246 / .92); color: var(--wxl-ink); font: 700 .5625rem/1.3 var(--wxl-sans); letter-spacing: .14em; text-transform: uppercase; opacity: 0; transition: opacity .4s; }
.wx-library .wxl-card.is-active .wxl-kind { opacity: 1; transition-delay: .25s; }
.wx-library .wxl-caption { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 20px 18px; display: grid; justify-items: center; gap: 6px; text-align: center; color: #fff; opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .5s cubic-bezier(.2, .7, .1, 1); pointer-events: none; }
.wx-library .wxl-card.is-active .wxl-caption { opacity: 1; transform: none; transition-delay: .25s; }
.wx-library .wxl-card.is-blank .wxl-caption { color: var(--wxl-ink); }
.wx-library .wxl-meta { font: 700 .625rem/1.3 var(--wxl-sans); letter-spacing: .18em; text-transform: uppercase; color: #ffb59c; }
.wx-library .wxl-card.is-blank .wxl-meta { color: var(--wxl-rust-text); }
.wx-library .wxl-name { font: 700 clamp(1.375rem, 2.2vw, 1.875rem)/1.05 var(--wxl-sans); letter-spacing: -.035em; }
.wx-library .wxl-tag { max-width: 28ch; font-size: .8125rem; line-height: 1.5; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wx-library .wxl-open { margin-top: 8px; padding: 9px 16px; border-radius: 100px; background: #fff; color: var(--wxl-ink); font-size: .75rem; font-weight: 600; }
.wx-library .wxl-card.is-blank .wxl-open { background: var(--wxl-ink); color: var(--wxl-paper); }
.wx-library .wxl-spot-progress { display: flex; align-items: center; justify-content: center; gap: 14px; font: 600 .6875rem/1 var(--wxl-sans); letter-spacing: .16em; color: var(--wxl-ink-dim); font-variant-numeric: tabular-nums; }
.wx-library .wxl-spot-bar { position: relative; width: min(220px, 40vw); height: 2px; border-radius: 2px; background: var(--wxl-line); overflow: hidden; }
.wx-library .wxl-spot-bar span { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--wxl-rust); transition: transform .5s cubic-bezier(.2, .7, .1, 1); }

/* List: one row per dossier. */
.wx-library .wxl-list { margin-top: 8px; }
.wx-library .wxl-list[hidden] { display: none; }
.wx-library .wxl-list a { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 18px 4px; border-bottom: 1px solid var(--wxl-line); transition: background-color .2s; }
.wx-library .wxl-list a:hover { background: var(--wxl-paper-2); }
.wx-library .wxl-list .wxl-no { font-size: .75rem; color: var(--wxl-ink-dim); font-variant-numeric: tabular-nums; }
.wx-library .wxl-list .wxl-row-name { font: 700 1.125rem/1.2 var(--wxl-sans); letter-spacing: -.02em; }
.wx-library .wxl-list .wxl-row-meta { grid-column: 2; font-size: .8125rem; color: var(--wxl-ink-dim); }
.wx-library .wxl-list .wxl-arrow { grid-column: 3; grid-row: 1 / 3; align-self: center; color: var(--wxl-rust); }
.wx-library .wxl-empty { margin-top: 32px; display: grid; gap: 16px; justify-items: start; }
.wx-library .wxl-empty[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .wx-library .wxl-bob { animation: none; }
  .wx-library .wxl-words span, .wx-library .wxl-card, .wx-library .wxl-caption, .wx-library .wxl-spot-glow img { transition: none; }
}

/* Keep the scene title legible against the dark reading room. */
.wx-library .wxl-title h1{color:#fff!important}

/* Keep pinned scenes stable and economical on touch screens. */
@media (pointer:coarse){.wx-library .wxl-layer{will-change:auto}.wx-library .wxl-stage{isolation:isolate}.wx-library .wxl-title{filter:none!important}}

@media(max-width:600px){.wx-library .wxl-hud-br{bottom:64px}}
