:root {
  --paper: #f4f0e8;
  --paper-light: #faf7f0;
  --ink: #122624;
  --room: #163d39;
  --mint: #8ed6cf;
  --cream: #f7f2e8;
  --mustard: #efb42b;
  --rust: #b86a47;
  --muted: #61706b;
  --rule: #c9c2b7;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html {
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

a { color: inherit; }

.to-skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--cream);
  transform: translateY(-160%);
}

.to-skip-link:focus { transform: translateY(0); }

.to-site-bar {
  position: relative;
  z-index: 10;
  min-height: 78px;
  display: flex;
  gap: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid rgba(255, 255, 255, .28);
  color: var(--cream);
  background: var(--room);
}

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

.to-brand-mark {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 3px;
  width: 23px;
  height: 23px;
  transform: rotate(-2deg);
}

.to-brand-mark i {
  display: block;
  border: 1px solid rgba(247, 242, 232, .8);
}

.to-brand-mark i:first-child { background: var(--mint); }
.to-brand-mark i:last-child {
  border-color: var(--mustard);
  background: var(--mustard);
}

.to-site-name {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: .14em;
}

.to-site-nav {
  display: flex;
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
}

.to-site-nav a {
  padding: 7px 0 6px;
  border-bottom: 1px solid rgba(247, 242, 232, .7);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
}

.library-welcome {
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(0, 42%);
  min-height: 410px;
  border-bottom: 1px solid var(--rule);
}

.library-hero-slot {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  background: #eee8dc;
}

.library-hero-slot::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(to right, rgba(244, 240, 232, .03) 65%, var(--paper) 100%);
}

.library-hero-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  filter: saturate(.82) contrast(.96) brightness(1.05);
}

.library-welcome-copy {
  align-self: center;
  padding: 48px clamp(32px, 6vw, 82px) 48px clamp(24px, 4vw, 60px);
}

.library-kicker,
.library-catalog-head,
.library-pathway span,
.quiet-room-kicker,
.about-library .section-kicker,
.to-site-footer {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.library-kicker,
.quiet-room-kicker,
.about-library .section-kicker {
  margin: 0 0 18px;
  color: #487d78;
}

.library-welcome h1 {
  max-width: 680px;
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 82px);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: .94;
}

.library-welcome-copy > p:last-child {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(18px, 2.1vw, 23px);
  font-style: italic;
  line-height: 1.45;
}

.library-catalog {
  padding: 52px clamp(28px, 7vw, 110px) 58px;
}

.library-catalog-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--room);
}

.library-catalog-head span:last-child { color: var(--muted); }

.library-catalog ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.library-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(168px, 220px) 26px;
  gap: 18px;
  align-items: center;
  min-height: 104px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.library-row:hover,
.library-row:focus-visible {
  background: rgba(255, 255, 255, .34);
  outline: none;
}

.library-row-number {
  color: var(--rust);
  font-size: 12px;
}

.library-row-title {
  font-family: var(--serif);
  font-size: clamp(21px, 2.35vw, 32px);
  font-weight: 400;
  letter-spacing: -.022em;
  line-height: 1.08;
}

.library-row-category {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.25;
}

.library-row-arrow {
  font-family: var(--serif);
  font-size: 24px;
  text-align: right;
}

.quiet-room-invitation {
  display: grid;
  grid-template-columns: minmax(140px, .55fr) minmax(0, 2fr) auto;
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
  padding: 42px clamp(28px, 7vw, 110px) 46px;
  border-top: 1px solid rgba(18, 38, 36, .12);
  color: var(--cream);
  background: #6a716d;
}

.quiet-room-kicker {
  margin: 0;
  color: #d5eeeb;
}

.quiet-room-invitation h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.7vw, 48px);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.03;
}

.quiet-room-invitation .quiet-room-question {
  margin: 0;
  color: rgba(247, 242, 232, .75);
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
}

.quiet-room-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid rgba(247, 242, 232, .7);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.library-pathways {
  display: grid;
  grid-template-columns: 1fr 1fr;
  color: var(--cream);
  background: var(--room);
}

.library-pathway {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px clamp(28px, 7vw, 110px);
  text-decoration: none;
}

.library-pathway + .library-pathway {
  border-left: 1px solid rgba(247, 242, 232, .36);
}

.library-pathway span {
  margin-bottom: 9px;
  color: var(--mint);
}

.library-pathway strong {
  font-family: var(--serif);
  font-size: clamp(20px, 2.3vw, 29px);
  font-weight: 400;
  line-height: 1.2;
}

.about-library {
  display: grid;
  grid-template-columns: minmax(180px, .6fr) minmax(0, 1.8fr);
  gap: clamp(30px, 7vw, 110px);
  padding: 66px clamp(28px, 7vw, 110px) 72px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-light);
}

.about-library .section-kicker { margin-top: 8px; }

.about-library h2 {
  max-width: 820px;
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .98;
}

.about-library p:last-child {
  max-width: 760px;
  margin: 0;
  color: #52615c;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
}

.to-site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 30px;
  align-items: center;
  padding: 23px 40px 26px;
  color: #50605b;
  background: var(--paper);
}

.to-footer-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--serif);
}

.to-footer-mark {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 2px;
}

.to-footer-mark i {
  width: 6px;
  height: 6px;
  border: 1px solid #50605b;
}

.to-footer-mark i:first-child { background: #8abeb7; }
.to-footer-mark i:last-child {
  border-color: var(--mustard);
  background: var(--mustard);
}

.to-footer-nav {
  display: flex;
  gap: 24px;
  margin: 0;
}

.to-footer-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid rgba(80, 96, 91, .48);
  text-decoration: none;
}

.to-copyright {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #69746f;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

/* The captured essay layouts remain intact; these rules supply the shared
   Contender L masthead, footer, and the surfaced Quiet Room invitation. */
.contender-l-essay .to-site-bar {
  width: 100%;
}

.contender-l-essay .essay-hero { border-top: 0; }

.essay-quiet-room {
  display: grid;
  grid-template-columns: minmax(150px, .55fr) minmax(0, 2fr) auto;
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
  padding: 34px clamp(24px, 6vw, 86px) 38px;
  color: var(--cream);
  background: #6a716d;
}

.essay-quiet-room > p:first-child {
  margin: 0;
  color: #d5eeeb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.essay-quiet-room h2 {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: clamp(25px, 3.2vw, 43px);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.05;
}

.essay-quiet-room div p {
  margin: 0;
  color: rgba(247, 242, 232, .75);
  font-family: var(--serif);
  font-style: italic;
}

.essay-quiet-room a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid rgba(247, 242, 232, .65);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.contender-l-essay .to-site-footer {
  border-top: 1px solid var(--rule);
}

@media (max-width: 860px) {
  .to-site-bar { padding: 15px 22px; }
  .to-site-name { font-size: 21px; }
  .to-site-nav { gap: 23px; }
  .to-site-nav a { font-size: 10px; }
}

@media (max-width: 820px) {

  .library-welcome {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .library-hero-slot { min-height: 310px; }
  .library-welcome-copy { padding: 42px 34px 46px; }

  .library-row {
    grid-template-columns: 36px minmax(0, 1fr) 26px;
    gap: 13px;
    padding: 17px 0;
  }

  .library-row-category { grid-column: 2; }
  .library-row-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .quiet-room-invitation,
  .essay-quiet-room {
    grid-template-columns: 1fr;
  }

  .quiet-room-link,
  .essay-quiet-room a { width: fit-content; }
}

@media (max-width: 560px) {
  .to-site-bar {
    min-height: 69px;
    gap: 14px;
    align-items: center;
    padding: 12px 17px;
  }

  .to-brand-lockup { gap: 10px; }
  .to-brand-mark {
    grid-template-columns: repeat(2, 7px);
    grid-template-rows: repeat(2, 7px);
    gap: 2px;
    width: 16px;
    height: 16px;
  }

  .to-site-name {
    max-width: 94px;
    font-size: 16px;
    line-height: 1;
  }

  .to-site-nav {
    flex: 1;
    justify-content: flex-end;
    gap: 14px;
  }

  .to-site-nav a {
    padding: 7px 0 4px;
    font-size: 8px;
    letter-spacing: .12em;
  }

  .library-hero-slot { min-height: 248px; }
  .library-hero-slot img { object-position: 8% center; }
  .library-welcome-copy { padding: 36px 24px 40px; }
  .library-welcome h1 { font-size: 49px; }

  .library-catalog { padding: 37px 24px 40px; }
  .library-catalog-head { align-items: flex-end; }
  .library-row { min-height: 112px; }
  .library-row-title { font-size: 23px; }

  .quiet-room-invitation,
  .essay-quiet-room { padding: 34px 24px 38px; }

  .library-pathways { grid-template-columns: 1fr; }
  .library-pathway { min-height: 116px; padding: 25px 24px 28px; }
  .library-pathway + .library-pathway {
    border-top: 1px solid rgba(247, 242, 232, .36);
    border-left: 0;
  }

  .about-library {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 50px 24px 56px;
  }

  .about-library h2 { font-size: 43px; }
  .about-library p:last-child { font-size: 18px; }

  .to-site-footer {
    grid-template-columns: 1fr;
    padding: 21px 20px 24px;
  }

  .to-footer-nav {
    flex-wrap: wrap;
    gap: 8px 18px;
  }

  .to-copyright { grid-column: 1; }
}

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