@font-face {
  font-family: "Dirty Ink";
  src: url("../fonts/dirty-ink-regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/bodoni-moda.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 400;
  src: url("../fonts/bodoni-moda-italic.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/courier-prime.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #fff;
  --ink: #111;
  --grey: #767676;
  --rule: #e2e2e2;
  --red: #e2231a;
  --tile: #f2f1ee;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --display: "Dirty Ink", Georgia, "Times New Roman", serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;

  --max: 77.5rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-gap: clamp(6rem, 14vw, 10rem);
  --nav-gap: clamp(0.6rem, 3.5vw, 2.5rem);
  --lb-pad: clamp(1rem, 3vw, 3rem);
}

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

html {
  font-size: clamp(100%, 1vw, 137.5%);
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height, 0px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

a,
button {
  color: inherit;
}

a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (hover: hover) {
  a:hover,
  button:hover {
    color: var(--red);
  }
}

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

.header {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 24px var(--gutter) 10px;
}

.logo {
  position: absolute;
  top: 16px;
  left: var(--gutter);
  width: clamp(3.5rem, 8vw, 7rem);
}

.wordmark {
  margin: 0;
  font: 400 clamp(2rem, min(11vw, 15vh), 5.2rem)/1.05 var(--display);
  letter-spacing: 0.01em;
  text-align: center;
}

.wordmark a {
  text-decoration: none;
}

.wordmark a:hover {
  color: inherit;
}

.tagline {
  margin: 6px 0 0;
  font: 400 clamp(1.4rem, 3vw, 1.8rem)/1.2 var(--display);
  text-align: center;
}

.clock {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--grey);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px var(--nav-gap);
  padding: 14px var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  font-size: clamp(0.75rem, 3.7vw, 0.95rem);
}

.nav a {
  margin: -14px calc(var(--nav-gap) / -2);
  padding: 14px calc(var(--nav-gap) / 2);
}

.footer a {
  margin: -10px -8px;
  padding: 10px 8px;
}

.banner {
  height: clamp(3rem, min(9vw, 12vh), 8.75rem);
  background: var(--ink) center / cover no-repeat;
}

.banner-top {
  background-image: url("../images/banner-top.jpg");
}

.banner-bottom {
  background-image: url("../images/banner-bottom.jpg");
}

.work {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) var(--gutter) 0;
}

.collection + .collection {
  margin-top: var(--section-gap);
}

.collection-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  margin-bottom: clamp(32px, 5vw, 56px);
}

.collection-photo {
  width: 100%;
  border: 6px solid var(--ink);
}

.collection-kicker {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--grey);
}

.collection-title {
  margin: 0;
  font: 400 clamp(2.8rem, 7.5vw, 5rem)/1.05 var(--display);
}

.collection-meta {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--grey);
}

.collection-desc {
  max-width: 56ch;
  margin: 12px 0 0;
  font: 400 1.15rem/1.5 var(--serif);
}

.grid {
  --columns: 1;
  --column-gap: clamp(16px, 3vw, 32px);

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(48px, 7vw, 80px) var(--column-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid > li {
  flex: 0 0 calc((100% - (var(--columns) - 1) * var(--column-gap)) / var(--columns));
}

.piece {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.piece:hover {
  color: inherit;
}

.piece-img {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--tile);
  border: 6px solid var(--ink);
}

.piece-img img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.6s ease;
}

@media (hover: hover) {
  .piece:hover .piece-img img {
    transform: scale(1.02);
  }
}

.piece-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.5;
}

.piece-cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--grey);
}

.piece-buy {
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
  color: var(--ink);
}

.piece-price,
.piece-action {
  white-space: nowrap;
}

.piece-action {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .piece:hover .piece-format {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }

  .piece:hover .piece-action {
    color: var(--red);
  }
}

.poetry,
.contact {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--section-gap) var(--gutter) 0;
  text-align: center;
}

.contact {
  padding-bottom: var(--section-gap);
}

.eyebrow {
  margin: 0 0 20px;
  font: 400 0.85rem/1 var(--mono);
  color: var(--grey);
}

.books {
  width: min(100%, 20rem, 62vh);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.book .piece-img img {
  aspect-ratio: 880 / 1268;
}

.contact-note {
  max-width: 46ch;
  margin: 0 auto 32px;
  font: italic 400 clamp(1.1rem, 2.2vw, 1.3rem)/1.6 var(--serif);
}

.contact-link {
  display: table;
  margin: 0 auto;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  overflow-wrap: anywhere;
}

.contact-link + .contact-link {
  margin-top: 12px;
}

.contact-social {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 18px auto 0;
  padding: 6px;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
}

.contact-social svg {
  flex: none;
  width: 2rem;
  height: 2rem;
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  padding: 24px var(--gutter) 32px;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--grey);
}

.footer > a {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  align-self: start;
}

.credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.credit img {
  width: auto;
  height: 1.5rem;
}

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

@media (hover: hover) {
  .credit a:hover {
    color: var(--red);
  }
}

.lightbox {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--bg);
  color: var(--ink);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: fade 0.2s ease;
}

.lightbox button {
  margin: -8px -10px;
  padding: 12px 10px;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (hover: hover) {
  .lightbox button:hover {
    color: var(--red);
  }
}

.lightbox button:disabled {
  color: var(--rule);
  text-decoration: none;
  cursor: default;
}

.lb-bar,
.lb-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--gutter);
  font-size: 0.95rem;
}

.lb-bar {
  border-bottom: 1px solid var(--rule);
  color: var(--grey);
}

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

.lb-page {
  display: grid;
  min-height: 0;
  overflow-y: auto;
  container-type: size;
}

.lb-figure {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  width: 100%;
  max-width: var(--max);
  margin: auto;
  padding: var(--lb-pad) var(--gutter);
}

.lb-figure.is-cover {
  align-items: start;
}

.lb-figure.is-poem {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.2fr);
  align-items: start;
}

.lb-frame {
  display: grid;
  place-items: center;
}

.lb-frame img {
  width: auto;
  max-height: calc(100vh - 200px);
  max-height: calc(100cqh - 2 * var(--lb-pad));
  border: 8px solid var(--ink);
}

.is-cover .lb-frame img {
  border: 0;
}

.lb-kicker {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--grey);
}

.lb-title {
  margin: 0 0 12px;
  font: 400 clamp(2.2rem, 4.4vw, 3.2rem)/1.1 var(--display);
}

.lb-desc {
  margin: 0 0 24px;
  font: italic 400 1.1rem/1.5 var(--serif);
}

.lb-desc:empty {
  display: none;
}

.lb-meta {
  margin: 0;
  font-size: 0.9rem;
}

.lb-meta div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.lb-meta dt {
  color: var(--grey);
}

.lb-meta dd {
  margin: 0;
  text-align: right;
}

.lb-buy {
  margin: 16px 0 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.lightbox .reader-start {
  margin-top: 20px;
}

.lb-heading {
  margin: 40px 0 8px;
  font: 400 0.85rem/1 var(--mono);
  color: var(--grey);
}

.lb-body {
  margin: 0;
  font: 400 1.05rem/1.6 var(--serif);
}

.poem {
  margin: 0;
  font: italic 400 clamp(1.1rem, 1.8vw, 1.35rem)/1.75 var(--serif);
  text-align: center;
}

.poem + .lb-meta {
  margin-top: 32px;
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (min-width: 700px) {
  .grid {
    --columns: 2;
  }
}

@media (min-width: 1040px) {
  .grid {
    --columns: 3;
  }
}

@media (min-width: 480px) and (max-height: 500px) {
  .grid {
    --columns: 2;
  }
}

@media (min-width: 700px) and (max-height: 500px) {
  .grid {
    --columns: 3;
  }
}

@media (max-height: 500px) {
  :root {
    --lb-pad: 0.75rem;
  }

  .nav {
    padding-block: 8px;
  }

  .lb-bar,
  .lb-nav {
    padding-block: 6px;
  }
}

@media (max-width: 899px) and (min-height: 501px) {
  .header {
    padding-top: 56px;
  }

  .logo {
    position: static;
    justify-self: start;
    margin-bottom: 28px;
  }

  .collection-head {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .lb-figure,
  .lb-figure.is-poem {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .lb-frame img {
    max-height: 58vh;
    max-height: calc(100cqh - 2 * var(--lb-pad) - 4.5rem);
  }
}

@media (max-width: 519px) {
  .footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer > a {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .credit a {
    flex-basis: 100%;
  }
}

@media (max-width: 374px) {
  .credit > span {
    flex-basis: 100%;
  }
}

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

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