:root {
  color-scheme: light;
  --ivory: #f9f5eb;
  --paper: #fffcf5;
  --green: #12352c;
  --body: #354740;
  --violet: #65496e;
  --amber: #a87736;
  --line: #ded5be;
  --mat: #eee8db;
  --sans: "Instrument Sans", "Trebuchet MS", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --content: 66rem;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--green);
  font: 1rem/1.55 var(--sans);
}

h1, h2, h3, p { margin: 0; }
a { color: var(--violet); text-underline-offset: .25em; }
a:hover { color: var(--green); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; }

.hero {
  padding: clamp(4.75rem, 12vw, 8.75rem) var(--gutter) clamp(4.5rem, 10vw, 7rem);
  text-align: center;
  background: radial-gradient(ellipse at 50% 6%, var(--paper), transparent 73%);
}

.wordmark {
  font-size: clamp(3.7rem, 11.5vw, 8.15rem);
  font-weight: 700;
  line-height: .85;
  letter-spacing: -.071em;
  white-space: nowrap;
}

.wordmark span {
  color: var(--violet);
  font: 400 1.06em/.8 var(--serif);
  letter-spacing: -.046em;
}

.brand-name {
  margin-top: .95rem;
  font-size: clamp(.88rem, 2vw, 1.22rem);
  letter-spacing: .105em;
  font-weight: 500;
}

.hero h1 {
  margin-top: clamp(2.75rem, 7vw, 4.5rem);
  font: 400 clamp(3.35rem, 7.7vw, 6.2rem)/.98 var(--serif);
  letter-spacing: -.025em;
}

.intro, .series-heading p {
  color: var(--body);
  margin: 1.15rem auto 0;
  max-width: 49ch;
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.preview-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 1.05rem;
  font-weight: 600;
}

.series {
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: auto;
  padding: 0 var(--gutter) clamp(3rem, 8vw, 6.5rem);
}

.series-heading {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 0 0 clamp(2rem, 5vw, 3.4rem);
}

.series-heading::before {
  display: block;
  content: "";
  width: 3.5rem;
  height: 2px;
  margin: -1px auto clamp(2.25rem, 6vw, 3.6rem);
  background: var(--amber);
}

.series-heading h2 {
  scroll-margin-top: 1.25rem;
  font: 400 clamp(2.85rem, 6.5vw, 5.1rem)/.97 var(--serif);
  letter-spacing: -.025em;
  text-wrap: balance;
}

.series-heading p { max-width: 58ch; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.4rem, 4vw, 2.65rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
}

.poster {
  --mat-padding: clamp(.55rem, 1.4vw, .95rem);
  position: relative;
  aspect-ratio: 1 / 1.33;
  background: var(--mat);
}

.poster img {
  display: block;
  position: absolute;
  inset: var(--mat-padding);
  width: calc(100% - 2 * var(--mat-padding));
  height: calc(100% - 2 * var(--mat-padding));
  object-fit: contain;
}

.card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.15rem, 3vw, 1.7rem);
}

.card h3 { font: 400 clamp(2.15rem, 4vw, 3rem)/1 var(--serif); }
.card p { color: var(--body); margin: .35rem 0 .65rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0 1.1rem; margin-top: auto; }
.card-actions a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
footer { text-align: center; border-top: 1px solid var(--line); padding: 1.75rem var(--gutter); }

dialog {
  width: min(55rem, calc(100% - 1.25rem));
  max-width: none;
  max-height: 92dvh;
  padding: 0;
  color: var(--green);
  background: var(--ivory);
  border: 1px solid var(--line);
  overflow: hidden;
}

dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #12291fe0; }
body:has(dialog[open]) { overflow: hidden; }

.viewer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .4rem .95rem;
  border-bottom: 1px solid var(--line);
}

.viewer-bar h2 { font: 400 1.65rem/1 var(--serif); }
.viewer-bar button {
  min-height: 44px;
  padding: 0 .85rem;
  background: var(--paper);
  color: var(--green);
  border: 1px solid var(--line);
  font: 600 1rem var(--sans);
  cursor: pointer;
}

.viewer-image { overflow: auto; overscroll-behavior: contain; }
.viewer-image img { display: block; width: auto; max-width: 100%; height: auto; margin: auto; }

@media (max-width: 42rem) {
  .gallery { grid-template-columns: 1fr; }
  .poster { aspect-ratio: auto; padding: var(--mat-padding); }
  .poster img { position: static; width: 100%; height: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
