@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/spectral-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/spectral-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 300; font-display: swap; src: url("/fonts/spectral-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/spectral-400-italic.woff2") format("woff2"); }

/* Colours sampled from the painting: ash-grey snow, charcoal sky, rust dawn. */
@property --wall  { syntax: "<color>"; inherits: true; initial-value: #d3d1cc; }
@property --ink   { syntax: "<color>"; inherits: true; initial-value: #1f2124; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #484b50; }
@property --rust  { syntax: "<color>"; inherits: true; initial-value: #6e4312; }
@property --rule  { syntax: "<color>"; inherits: true; initial-value: rgb(31 33 36 / .25); }
@property --lit   { syntax: "<number>"; inherits: true; initial-value: 1; }

:root {
  --wall: #d3d1cc;
  --ink: #1f2124;
  --muted: #484b50;
  --rust: #6e4312;
  --rule: rgb(31 33 36 / .25);
  --lit: 1;
  --measure: 75rem; /* the painting's display width, 1200px */
  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --section-gap: clamp(4rem, 9vw, 7rem);
}

@media (prefers-color-scheme: dark) {
  :root { --wall: #151618; --ink: #c4c2bd; --muted: #8e8d8a; --rust: #c9955a; --rule: rgb(196 194 189 / .22); }
}

/* The one moment of motion: the wall comes up from night to morning grey. */
@media (prefers-color-scheme: light) and (prefers-reduced-motion: no-preference) {
  :root { animation: daybreak 2.8s cubic-bezier(.45, 0, .2, 1) .15s both; }
  @keyframes daybreak {
    from { --wall: #151618; --ink: #151618; --muted: #151618; --rust: #151618; --rule: #151618; --lit: .45; }
    to   { --wall: #d3d1cc; --ink: #1f2124; --muted: #484b50; --rust: #6e4312; --rule: rgb(31 33 36 / .25); --lit: 1; }
  }
}

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

html { background: var(--wall); color: var(--ink); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding-inline: clamp(1rem, 6vw, 7.5rem);
  padding-block: clamp(1rem, 3vw, 2.5rem) clamp(3rem, 5vw, 4.5rem);
  background: var(--wall);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
}

.lang, main, footer { max-width: var(--measure); margin-inline: auto; }

p { text-wrap: pretty; }

a {
  color: var(--rust);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; border-radius: 2px; }

.lang {
  display: flex;
  justify-content: flex-end;
  margin-bottom: clamp(1rem, 3vw, 2.5rem);
  font-size: .9375rem;
}
.lang a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* The painting and its wall label */

.work { margin: 0; }
.work picture { display: block; }

.work img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio);
  background: #36383c;
  filter: brightness(var(--lit));
  /* hung on the wall rather than printed on the page */
  box-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 24px 48px -24px rgb(0 0 0 / .5);
}

.label {
  display: grid;
  gap: 1.75rem 4rem;
  margin-top: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

@media (min-width: 52rem) {
  .label { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

h1 {
  margin: 0;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.5rem, 1.1rem + 4.4vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.artist { margin: .875rem 0 0; font-size: 1.1875rem; line-height: 1.45; }
.artist strong { font-weight: 500; }
.artist span { color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: .5rem 1.25rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.5;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

@media (min-width: 52rem) {
  .facts { margin-top: .625rem; }
}

/* Text */

h2 {
  margin: 0 0 .75rem;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.375rem, 1.1rem + .8vw, 1.625rem);
  line-height: 1.3;
}

.notes {
  display: grid;
  gap: 3rem 4rem;
  margin-top: var(--section-gap);
}

@media (min-width: 52rem) {
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.notes section { max-width: 36em; }
.notes p { margin: 0 0 1em; hyphens: auto; }
.notes p:last-child { margin-bottom: 0; }

/* Up close */

.details { margin-top: var(--section-gap); }
.details h2 { margin-bottom: 1.5rem; }

.details-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(72%, 18rem);
  gap: 1rem;
  margin: 0 calc(-1 * clamp(1rem, 6vw, 7.5rem));
  padding: 0 clamp(1rem, 6vw, 7.5rem) .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: clamp(1rem, 6vw, 7.5rem);
  list-style: none;
}

.details-row li { scroll-snap-align: start; }

@media (min-width: 52rem) {
  .details-row {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-columns: auto;
    gap: 2rem;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

.details figure { display: flex; flex-direction: column; gap: .75rem; margin: 0; }

.details img {
  display: block;
  width: 100%;
  height: clamp(17.5rem, 29vw, 26.25rem);
  object-fit: cover;
  background: #36383c;
  filter: brightness(var(--lit));
}

.details figcaption { font-size: .9375rem; line-height: 1.5; color: var(--muted); }

.swipe { margin: .25rem 0 0; font-size: .9375rem; color: var(--muted); }
@media (min-width: 52rem) { .swipe { display: none; } }

/* Footer */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem 2rem;
  margin-top: var(--section-gap);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: .9375rem;
}

footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
footer li a { display: inline-flex; align-items: center; min-height: 2.75rem; }
footer p { margin: 0; }
