/* The Weird Library — shared institutional stylesheet
   Tokens are settled. Do not introduce a second palette. */

@font-face {
  font-family: "IM Fell English";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/im-fell-english-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IM Fell English";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/im-fell-english-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond-400-normal-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond-400-italic-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/eb-garamond-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/eb-garamond-500-normal-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/eb-garamond-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/eb-garamond-600-normal-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Special Elite";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/special-elite-400-normal.woff2") format("woff2");
}

:root {
  --ground: #152218;
  --panel: #1d2e21;
  --text: #e9e0c8;
  --card: #efe7d2;
  --ink: #22271f;
  --brass: #b08d3f;
  --oxblood: #7d2a20;
  --brass-bright: #d4b36a;
  --brass-deep: #6e5420;
  --hole: #101910;
  --muted: #c4b896;
  --rule: rgba(176, 141, 63, 0.45);
  --font-display: "IM Fell English", "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --font-body: "EB Garamond", Garamond, "Times New Roman", Times, serif;
  --font-type: "Special Elite", "Courier New", Courier, monospace;
  --measure: 40rem;
  --site: 72rem;
  --radius: 0.12rem;
  --focus: 3px solid var(--brass);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: var(--ground);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(176, 141, 63, 0.09), transparent 42%),
    radial-gradient(ellipse at 100% 100%, rgba(125, 42, 32, 0.08), transparent 36%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  font-weight: 400;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brass-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--text);
}

a:focus-visible,
button:focus-visible,
.nav-card:focus-visible,
.catalog-card:focus-visible,
.lib-card-cta:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  background: var(--card);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-type);
  font-size: 0.95rem;
}

.skip-link:focus {
  top: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site {
  width: min(100% - 2rem, var(--site));
  margin-inline: auto;
}

/* —— Masthead —— */

.masthead {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0 0;
}

.masthead-inner {
  width: min(100% - 2rem, var(--site));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: end;
  padding-bottom: 1.1rem;
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.wordmark a {
  color: var(--text);
  text-decoration: none;
}

.wordmark a:hover {
  color: var(--brass-bright);
}

.wordmark em {
  font-style: italic;
  color: var(--brass-bright);
}

.institution-tag {
  margin: 0.35rem 0 0;
  font-family: var(--font-type);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  max-width: 36rem;
}

.lib-card-cta {
  display: block;
  width: 13.5rem;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  padding: 0.55rem 0.75rem 0.7rem;
  font-family: var(--font-type);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.25);
  border: 1px solid #d9d0b4;
  position: relative;
  justify-self: end;
}

.lib-card-cta:hover {
  color: var(--ink);
  background: #f6f0dc;
}

.lib-card-cta .cta-kicker {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oxblood);
}

.lib-card-cta .cta-label {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.92rem;
}

.lib-card-cta .cta-number {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: #5a5f54;
}

/* —— Catalog-card navigation (cards on a brass rod) —— */

.card-nav {
  width: min(100% - 2rem, var(--site));
  margin: 0 auto;
  padding: 0.15rem 0 0;
}

.card-nav-caption {
  margin: 0 0 0.45rem;
  font-family: var(--font-type);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.drawer {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0 0.85rem;
  -webkit-overflow-scrolling: touch;
}

.nav-cards {
  list-style: none;
  margin: 0;
  padding: 0 0 0.35rem;
  display: flex;
  gap: 0.7rem;
  width: max-content;
  min-width: 100%;
  position: relative;
}

.nav-cards::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.72rem;
  height: 5px;
  background: linear-gradient(to bottom, var(--brass-bright), var(--brass) 48%, var(--brass-deep));
  border-radius: 99px;
  box-shadow: 0 1px 0 rgba(230, 201, 122, 0.55), 0 2px 5px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 0;
}

.nav-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 9.4rem;
  min-height: 7.6rem;
  padding: 0.7rem 0.65rem 1.65rem;
  background-color: var(--card);
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0 1.35rem,
    rgba(34, 39, 31, 0.07) 1.35rem calc(1.35rem + 1px)
  );
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-type);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.18), 0 8px 16px rgba(0, 0, 0, 0.22);
  border: 1px solid #d7ceb6;
  transition: transform 0.15s ease;
}

a.nav-card:hover {
  color: var(--ink);
  transform: translateY(-3px);
}

.nav-card[aria-current="page"] {
  box-shadow:
    0 0 0 2px var(--oxblood),
    2px 3px 0 rgba(0, 0, 0, 0.18);
}

.nav-card.is-unopened {
  opacity: 0.72;
  cursor: default;
}

.call-no {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--oxblood);
  margin: 0 0 0.35rem;
}

.nav-room {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0;
}

.nav-sub {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: #5a5f54;
}

.rod-hole {
  position: absolute;
  left: 50%;
  bottom: 0.42rem;
  width: 0.72rem;
  height: 0.72rem;
  margin-left: -0.36rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #3d5140, var(--hole) 62%);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(176, 141, 63, 0.4);
  z-index: 2;
}

/* —— Page frame —— */

main {
  display: block;
  padding: 2.25rem 0 3.5rem;
}

.page-head {
  margin-bottom: 2rem;
}

.page-head h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.15rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text);
}

.deck {
  margin: 0;
  max-width: 42rem;
  font-size: 1.2rem;
  color: var(--muted);
}

.crumb {
  margin: 0 0 1rem;
  font-family: var(--font-type);
  font-size: 0.78rem;
  color: var(--muted);
}

.crumb a {
  color: var(--brass-bright);
}

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(to right, var(--brass), transparent 85%);
  margin: 0.9rem 0 1.4rem;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 400;
  margin: 2.25rem 0 0.85rem;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

.prose {
  max-width: 42rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* —— Catalog cards (rooms, works, authors) —— */

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1.15rem;
}

.catalog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 13.5rem;
  padding: 1.1rem 1.05rem 2rem;
  background-color: var(--card);
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0 1.5rem,
    rgba(34, 39, 31, 0.065) 1.5rem calc(1.5rem + 1px)
  );
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-type);
  border: 1px solid #d7ceb6;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.16), 0 12px 22px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease;
}

a.catalog-card:hover {
  color: var(--ink);
  transform: translateY(-4px);
}

.catalog-card .call-no {
  font-size: 0.75rem;
}

.catalog-card .card-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0.15rem 0 0.4rem;
}

.catalog-card .card-author,
.catalog-card .card-meta {
  margin: 0 0 0.25rem;
  font-size: 0.86rem;
  color: #3c4136;
}

.catalog-card .card-note {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: #5a5f54;
}

.catalog-card .rod-hole {
  background:
    radial-gradient(circle at 35% 30%, #4a5d45, var(--ground) 62%);
}

.catalog-card.is-unopened {
  opacity: 0.78;
}

.stamp {
  display: inline-block;
  margin: 0.4rem 0 0;
  padding: 0.18rem 0.4rem;
  border: 2px solid var(--oxblood);
  color: var(--oxblood);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-5deg);
  align-self: flex-start;
}

/* —— Lectern feature (homepage) —— */

.lectern-now {
  margin-top: 2.75rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 1.5rem 1.5rem 1.7rem;
}

.lectern-now h2 {
  margin-top: 0;
}

.featured-work {
  background: var(--card);
  color: var(--ink);
  padding: 1.5rem 1.5rem 1.7rem;
  max-width: 40rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  position: relative;
}

.featured-work::before {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: -7px;
  height: 7px;
  background: linear-gradient(to bottom, var(--brass-bright), var(--brass-deep));
  border-radius: 2px 2px 0 0;
}

.featured-work h3 {
  margin: 0.2rem 0 0.3rem;
  font-size: 1.85rem;
}

.featured-work h3 a {
  color: var(--ink);
  text-decoration: none;
}

.featured-work h3 a:hover {
  color: var(--oxblood);
}

.featured-work .byline {
  font-family: var(--font-type);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.featured-work .byline a {
  color: var(--oxblood);
}

.featured-work p {
  font-family: var(--font-body);
  font-size: 1.12rem;
}

.featured-work .read-cta {
  font-family: var(--font-type);
  font-size: 0.9rem;
  color: var(--oxblood);
}

/* —— Reading layout —— */

.work-head {
  max-width: var(--measure);
  margin: 0 auto 1.75rem;
}

.work-head h1 {
  margin: 0.15rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.12;
}

.work-head .byline {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.work-head .byline a {
  color: var(--brass-bright);
}

.biblio {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.pd-line {
  margin: 0.75rem 0 0;
  font-family: var(--font-type);
  font-size: 0.82rem;
  color: var(--muted);
}

.lectern {
  background: var(--card);
  color: var(--ink);
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.4rem 2.1rem 2.8rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
  font-size: 1.22rem;
  line-height: 1.78;
}

.lectern a {
  color: var(--oxblood);
}

.lectern a:hover {
  color: var(--ink);
}

.lectern p {
  margin: 0 0 1.15em;
}

.lectern p:last-child {
  margin-bottom: 0;
}

.lectern h2,
.lectern h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 1.7em 0 0.55em;
}

.lectern h2 {
  font-size: 1.45rem;
}

.lectern h3 {
  font-size: 1.2rem;
}

code {
  font-family: var(--font-type);
  font-size: 0.86em;
  color: var(--brass-bright);
}

.withheld {
  margin: 0;
  padding: 2.2rem 1.25rem;
  border: 2px dashed var(--oxblood);
  color: var(--oxblood);
  font-family: var(--font-type);
  font-size: 1rem;
  text-align: center;
  line-height: 1.5;
  background: rgba(125, 42, 32, 0.04);
}

.work-foot {
  max-width: var(--measure);
  margin: 1.75rem auto 0;
  font-size: 1.05rem;
}

.see-also {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

/* —— Catalog entries —— */

.vital {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.35rem 1rem;
  margin: 0 0 1.5rem;
  max-width: 42rem;
  font-size: 1.05rem;
}

.vital dt {
  font-family: var(--font-type);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0;
  padding-top: 0.2rem;
}

.vital dd {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.02rem;
  background: var(--panel);
}

caption {
  text-align: left;
  font-family: var(--font-type);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  caption-side: top;
}

th,
td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

th {
  font-family: var(--font-type);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-bright);
  font-weight: 400;
  background: #16251a;
}

td cite {
  font-style: italic;
}

.influence,
.where-to-read {
  max-width: 42rem;
}

.related-authors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-type);
  font-size: 0.92rem;
}

/* —— Colophon / disclosure —— */

.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--rule);
  padding: 1.6rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.site-footer .site {
  display: grid;
  gap: 0.75rem;
}

.disclosure {
  margin: 0;
  max-width: 46rem;
}

.colophon {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
  font-style: italic;
}

.quiet-links {
  margin: 0.4rem 0 0;
  font-family: var(--font-type);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.quiet-links a {
  color: var(--brass);
}

.quiet-links a:hover {
  color: var(--brass-bright);
}

/* —— Hours plaque —— */

.hours {
  margin-top: 2.5rem;
  display: inline-block;
  border: 1px solid var(--brass);
  padding: 0.85rem 1.1rem;
  font-family: var(--font-type);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hours strong {
  display: block;
  color: var(--brass-bright);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

/* —— Responsive —— */

@media (max-width: 720px) {
  body {
    font-size: 1.05rem;
  }

  .masthead-inner {
    grid-template-columns: 1fr;
  }

  .lib-card-cta {
    justify-self: start;
    width: 100%;
    max-width: 18rem;
  }

  .lectern {
    padding: 1.5rem 1.15rem 1.9rem;
    font-size: 1.12rem;
  }

  .vital {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .vital dt {
    padding-top: 0.7rem;
  }

  .featured-work,
  .lectern-now {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  a.nav-card:hover,
  a.catalog-card:hover {
    transform: none;
  }

  .stamp {
    transform: none;
  }
}

@media (prefers-contrast: more) {
  a {
    text-decoration-thickness: 2px;
  }

  .nav-card,
  .catalog-card,
  .lectern,
  .featured-work {
    border: 2px solid var(--brass);
  }
}

@media print {
  .skip-link,
  .card-nav,
  .lib-card-cta,
  .quiet-links,
  .site-footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .lectern,
  .featured-work,
  .catalog-card {
    box-shadow: none;
    background: white;
    color: black;
  }

  a {
    color: black;
  }

  .work-head,
  .lectern,
  .work-foot {
    max-width: none;
  }
}
