/* poelzer.ca — shared styles. Edit freely. */

:root {
  --paper: #efe8d8;
  --paper-sheet: #f7f1e4;
  --paper-deep: #e4dcc8;
  --ink: #1c1812;
  --ink-soft: #5a5146;
  --cedar: #8a3d2a;
  --cedar-dark: #6c2f20;
  --rule: #d2c6b0;
  --rule-strong: #b9ab93;
  --display: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --measure: 38rem;
  --page: 68rem;
  --gutter: clamp(1.25rem, 4.5vw, 3rem);
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 70% at 50% -10%, var(--paper-sheet) 0%, transparent 55%),
    linear-gradient(180deg, transparent 0%, var(--paper-deep) 140%);
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.004em;
  font-variation-settings: "SOFT" 18, "WONK" 0;
  font-variant-numeric: oldstyle-nums;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * {
  position: relative;
  z-index: 1;
}

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

::selection {
  background: color-mix(in srgb, var(--cedar) 82%, var(--ink));
  color: var(--paper-sheet);
}

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

a:hover { color: var(--cedar-dark); }

:focus-visible {
  outline: 2px solid var(--cedar);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 30;
  font-family: var(--sans);
  font-size: 0.85rem;
}

.skip:focus { top: 0.6rem; }

/* Header — letterhead */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1.15rem var(--gutter) 1.05rem;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow:
    0 1px 0 var(--ink),
    0 4px 0 var(--paper),
    0 5px 0 var(--rule);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  font-variant: small-caps;
  font-variation-settings: "SOFT" 30, "WONK" 0.2;
}

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

.mark {
  width: 0.2rem;
  height: 1.05rem;
  background: var(--cedar);
  flex: 0 0 auto;
}

.nav-toggle {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 0.42rem 0.75rem;
  cursor: pointer;
}

.nav-toggle:hover {
  color: var(--cedar);
  border-color: var(--cedar);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-nav a:hover {
  color: var(--cedar);
}

.site-nav a[aria-current="page"] {
  color: var(--cedar);
}

@media (max-width: 719px) {
  .site-nav {
    display: none;
    flex-basis: 100%;
    padding: 0.15rem 0 0.35rem;
  }

  .site-header.is-open .site-nav { display: block; }

  .site-nav li + li { border-top: 1px solid var(--rule); }

  .site-nav a {
    display: block;
    padding: 0.85rem 0;
  }

  .site-nav a[aria-current="page"] {
    box-shadow: inset 0.2rem 0 0 var(--cedar);
    padding-left: 0.85rem;
  }
}

@media (min-width: 720px) {
  .nav-toggle { display: none; }

  .site-nav ul {
    display: flex;
    gap: 1.75rem;
  }

  .site-nav a {
    display: inline-block;
    padding: 0.15rem 0 0.2rem;
    box-shadow: inset 0 -2px 0 transparent;
  }

  .site-nav a:hover {
    box-shadow: inset 0 -2px 0 var(--rule-strong);
  }

  .site-nav a[aria-current="page"] {
    box-shadow: inset 0 -2px 0 var(--cedar);
  }
}

/* Main layout */

.page {
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: clamp(2.4rem, 6vw, 4rem) var(--gutter) clamp(4rem, 10vw, 6.5rem);
  flex: 1 0 auto;
}

.page-home {
  padding-top: clamp(3.4rem, 11vw, 6.75rem);
}

.kicker {
  margin: 0 0 0.85rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-variation-settings: "SOFT" 45, "WONK" 0.55;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.35rem, 7vw, 3.9rem);
  max-width: 16ch;
}

.page-home h1 {
  font-size: clamp(2.7rem, 8.5vw, 4.6rem);
  max-width: 11ch;
  margin-bottom: 1.7rem;
}

h1 em {
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "SOFT" 60, "WONK" 0.8;
}

h2 {
  margin: 2.8rem 0 0.9rem;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-variation-settings: "SOFT" 35, "WONK" 0.3;
}

.lede {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(1.15rem, 2.3vw, 1.32rem);
  line-height: 1.58;
  font-variation-settings: "SOFT" 22, "WONK" 0;
  text-wrap: pretty;
}

.page-home .lede {
  max-width: 37rem;
}

.prose {
  max-width: var(--measure);
}

.prose p {
  margin: 0 0 1.15rem;
  text-wrap: pretty;
}

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

.quiet { color: var(--ink-soft); }

/* Home contents */

.rooms {
  margin: clamp(3.2rem, 9vw, 5.4rem) 0 0;
  padding: 1.15rem 0 0;
  list-style: none;
  max-width: 42rem;
  border-top: 1px solid var(--ink);
}

.rooms li {
  border-bottom: 1px solid var(--rule);
}

.rooms a {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 1.05rem 0 1rem;
  color: inherit;
  text-decoration: none;
}

.rooms a:hover { color: inherit; }

.rooms a:hover .room-name { color: var(--cedar-dark); }

.rooms a:hover .room-dots {
  border-bottom-color: var(--cedar);
}

.room-name {
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cedar);
  min-width: 6.5rem;
}

.room-dots {
  flex: 1 1 auto;
  min-width: 1.25rem;
  border-bottom: 1px dotted var(--rule-strong);
  transform: translateY(-0.38em);
}

.room-note {
  flex: 0 1 auto;
  margin: 0;
  max-width: 22rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.4;
}

@media (max-width: 620px) {
  .rooms a {
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    padding: 1.1rem 0;
  }

  .room-dots { display: none; }

  .room-name { min-width: 0; width: 100%; }

  .room-note { max-width: none; }
}

/* Family — blank register */

.reserved {
  margin-top: 2.6rem;
  padding: 3.4rem 1.4rem 1.35rem;
  min-height: 16.5rem;
  max-width: 46rem;
  background-color: var(--paper-sheet);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 1.9rem,
    color-mix(in srgb, var(--rule) 85%, transparent) 1.9rem,
    color-mix(in srgb, var(--rule) 85%, transparent) calc(1.9rem + 1px)
  );
  border: 1px solid var(--rule);
  border-left: 0.22rem solid var(--cedar);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.reserved p {
  max-width: 28rem;
  margin: 0;
  font-style: italic;
  font-size: 1.05rem;
}

/* Library */

.shelves {
  display: grid;
  gap: 2.8rem;
  margin-top: 2.4rem;
}

@media (min-width: 820px) {
  .shelves {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 3.5rem;
    align-items: start;
  }
}

.shelf {
  border-top: 2px solid var(--ink);
  padding-top: 1.05rem;
}

.shelf h2 {
  margin: 0 0 0.3rem;
}

.shelf-count {
  margin: 0 0 1.35rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.book-list li,
.book-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.book-cover {
  flex: 0 0 auto;
  width: 72px;
  height: 108px;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  object-position: center;
  border-radius: 2px;
  background: #efe8d8;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent),
    0 6px 14px color-mix(in srgb, var(--ink) 10%, transparent);
}

.book-body {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 0.1rem;
}

.book-title {
  display: block;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.25;
  font-variation-settings: "SOFT" 30, "WONK" 0.25;
}

.book-meta {
  display: block;
  margin-top: 0.22rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-family: var(--sans);
}

.book-note {
  display: block;
  margin-top: 0.4rem;
  font-style: italic;
}

@media (max-width: 520px) {
  .book-cover {
    width: 60px;
    height: 90px;
  }

  .book-title {
    font-size: 1.05rem;
  }
}

.empty-shelf {
  margin: 0;
  padding: 0.85rem 0 1.1rem 1.05rem;
  max-width: 22rem;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  border-left: 2px solid var(--rule-strong);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 1.7rem,
    color-mix(in srgb, var(--rule) 70%, transparent) 1.7rem,
    color-mix(in srgb, var(--rule) 70%, transparent) calc(1.7rem + 1px)
  );
}


/* Library — full shelf cover grid */

.shelves-stack {
  grid-template-columns: 1fr;
}

@media (min-width: 820px) {
  .shelves.shelves-stack {
    grid-template-columns: 1fr;
  }
}

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

@media (min-width: 640px) {
  .cover-grid {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 1.15rem 1rem;
  }
}

@media (min-width: 980px) {
  .cover-grid {
    grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr));
  }
}

.cover-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.cover-thumb {
  display: block;
  height: auto;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  object-position: center;
  border-radius: 3px;
  background: #efe8d8;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent),
    0 8px 18px color-mix(in srgb, var(--ink) 12%, transparent);
}

.cover-caption {
  min-width: 0;
  padding: 0 0.1rem;
}

.cover-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  font-variation-settings: "SOFT" 30, "WONK" 0.25;
}

.cover-author {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.3;
}

.cover-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cedar);
}

.cover-file {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-card.is-untitled .cover-thumb {
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 6%, transparent),
    0 5px 12px color-mix(in srgb, var(--ink) 8%, transparent);
}

.cover-open {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  min-width: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cover-open:hover .cover-title,
.cover-open:focus-visible .cover-title {
  color: var(--cedar-dark);
}

.cover-open:hover .cover-thumb {
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent),
    0 12px 22px color-mix(in srgb, var(--ink) 16%, transparent);
}

body.book-dialog-open {
  overflow: hidden;
}

.book-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.book-dialog[hidden] {
  display: none;
}

.book-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 48%, transparent);
}

.book-dialog-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: auto;
  margin: 0;
  padding: 1.15rem 1.15rem 2rem;
  background: var(--paper-sheet);
  color: var(--ink);
  box-shadow: 0 -12px 40px color-mix(in srgb, var(--ink) 18%, transparent);
}

.book-dialog-close {
  align-self: flex-end;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 0.42rem 0.75rem;
  cursor: pointer;
}

.book-dialog-close:hover {
  color: var(--cedar);
  border-color: var(--cedar);
}

.book-dialog-head {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 1rem 1.05rem;
  align-items: end;
  margin: 0.85rem 0 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--ink);
}

.book-dialog-cover {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  object-position: center bottom;
  background: var(--paper);
  border-radius: 2px;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent),
    0 8px 18px color-mix(in srgb, var(--ink) 12%, transparent);
}

.book-dialog-group {
  margin: 0 0 0.45rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cedar);
}

.book-dialog-panel h2 {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2.15rem);
  max-width: 16ch;
}

.book-dialog-author {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.35;
}

.book-dialog-body {
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.68;
  font-variation-settings: "SOFT" 20, "WONK" 0;
}

.book-dialog-body p {
  margin: 0 0 1.05rem;
  max-width: 38rem;
  text-wrap: pretty;
}

.book-dialog-body p:last-child {
  margin-bottom: 0;
}

@media (min-width: 720px) {
  .book-dialog {
    display: grid;
    place-items: center;
    padding: 1.5rem;
  }

  .book-dialog-panel {
    width: min(42rem, 100%);
    height: auto;
    max-height: min(40rem, calc(100% - 1rem));
    padding: 1.25rem 1.6rem 1.8rem;
    border: 1px solid var(--rule);
    box-shadow:
      0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent),
      0 24px 50px color-mix(in srgb, var(--ink) 18%, transparent);
  }

  .book-dialog-head {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 1.2rem 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-open:hover .cover-thumb {
    box-shadow:
      0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent),
      0 8px 18px color-mix(in srgb, var(--ink) 12%, transparent);
  }
}

/* Board — a letter on the desk */

.letter {
  margin-top: 2.4rem;
  max-width: 38rem;
  padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.3rem, 4vw, 2.2rem) 1.85rem;
  background: var(--paper-sheet);
  border: 1px solid var(--rule);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 6%, transparent),
    0 18px 40px color-mix(in srgb, var(--ink) 7%, transparent);
}

.letter-head {
  padding-bottom: 1.15rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--ink);
}

.letter-from {
  margin: 0 0 0.2rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.contact-email {
  margin: 0;
  font-size: clamp(1.45rem, 3.4vw, 1.95rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 40, "WONK" 0.35;
}

.contact-email a {
  color: var(--ink);
  text-decoration-color: var(--cedar);
  text-underline-offset: 0.12em;
}

.contact-email a:hover { color: var(--cedar); }

.letter-salute {
  margin: 0 0 1.35rem;
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "SOFT" 50, "WONK" 0.6;
}

.field { margin: 0 0 1.2rem; }

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.req { color: var(--cedar); }

.letter-sign {
  margin-top: 1.6rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--rule);
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 0.45rem 0 0.5rem;
}

textarea {
  min-height: 11rem;
  resize: vertical;
  line-height: 1.7;
  border: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(1.7em - 1px),
    var(--rule) calc(1.7em - 1px),
    var(--rule) 1.7em
  );
  background-attachment: local;
  padding: 0 0.1rem 0.4rem;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--ink-soft) 70%, var(--paper));
  font-style: italic;
}

input:focus,
textarea:focus {
  outline: none;
  border-bottom-color: var(--cedar);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.4rem;
  margin-top: 0.5rem;
}

button[type="submit"] {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-sheet);
  background: var(--cedar);
  border: 0;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
}

button[type="submit"]:hover { background: var(--cedar-dark); }

.form-note {
  margin: 1.35rem 0 0;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.form-status {
  margin: 0.9rem 0 0;
  min-height: 1.4em;
  color: var(--cedar-dark);
  font-style: italic;
}

/* Footer — colophon */

.site-footer {
  margin-top: auto;
  padding: 1.2rem var(--gutter) 1.8rem;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover { color: var(--cedar); }

@media print {
  body::before { display: none; }
  .site-header { position: static; box-shadow: none; border-bottom: 1px solid #000; }
  .nav-toggle, .site-nav { display: none; }
  .letter { box-shadow: none; }
  a { color: inherit; }
}
