/* Leonard L. Pisaniello
   An estate-style catalogue: white walls so works on paper sit naturally,
   Caslon for his name and titles, a plain sans for details, work grouped by year. */

:root {
  --bg: #ffffff;
  --ink: #1d1c1a;
  --soft: #5e5a54;        /* secondary text, 6.6:1 on white */
  --rule: #e7e4de;
  --tint: #f5f3ef;        /* quiet panels */
  --focus: #2f5fd0;

  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4.5vw, 72px);
  --max: 1440px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
cite { font-style: italic; }   /* artwork titles are set in italics, as in a catalogue */

.skip {
  position: absolute; left: var(--gutter); top: 8px;
  background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Header and footer */
header.site, footer.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px var(--gutter);
}
header.site .name {
  font: 400 clamp(1.25rem, 2vw, 1.5rem)/1.1 var(--display);
  text-decoration: none;
  letter-spacing: 0.005em;
}
header.site nav, footer.site nav { display: flex; gap: 1.75rem; }
header.site nav a, footer.site nav a {
  font: 500 0.95rem/1 var(--sans);
  color: var(--soft);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}
header.site nav a:hover, footer.site nav a:hover { color: var(--ink); }
header.site nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }

footer.site {
  margin-top: 120px;
  border-top: 1px solid var(--rule);
  padding-top: 28px;
  padding-bottom: 48px;
  color: var(--soft);
  font-size: 0.9rem;
}
footer.site p { margin: 0; font-family: var(--display); font-size: 1.05rem; color: var(--ink); }

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Homepage opening: words left, one large work right */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 110px);
  align-items: end;
  padding: clamp(24px, 6vw, 88px) 0 clamp(56px, 8vw, 120px);
}
.hero h1 {
  margin: 0 0 24px;
  font: 400 clamp(2.6rem, 6vw, 5.2rem)/1 var(--display);
  letter-spacing: -0.015em;
}
.hero .lead {
  margin: 0 0 14px;
  font: 400 clamp(1.2rem, 1.8vw, 1.5rem)/1.45 var(--serif);
  color: var(--ink);
  max-width: 24em;
}
.hero-text p { margin: 0 0 10px; color: var(--soft); font-size: 1.05rem; max-width: 34em; }
.hero .links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 30px; }
.hero .links a { font: 500 1rem/1 var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 0.35em; }
.hero .links a:hover { text-decoration-thickness: 2px; }

.hero-art { margin: 0; justify-self: center; }
.hero-art img { max-height: min(72vh, 760px); width: auto; margin: 0 auto; }
.hero-art figcaption { margin-top: 14px; font: 400 0.95rem/1.4 var(--serif); color: var(--soft); }
.hero-art figcaption cite { color: var(--ink); }

/* Works, grouped by year */
.works { border-top: 1px solid var(--rule); padding-top: 40px; }
.works-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  margin-bottom: 24px;
}
.works-head h2 { margin: 0; font: 400 clamp(1.8rem, 3vw, 2.4rem)/1.1 var(--display); }
.years { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 500 0.9rem/1.6 var(--sans); }
.years a { color: var(--soft); text-decoration: none; }
.years a:hover { color: var(--ink); text-decoration: underline; }

.year {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 24px;
  padding: 44px 0 20px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 16px;
}
.year:first-of-type { border-top: 0; }
.year h3 {
  margin: 0;
  font: 400 1.6rem/1 var(--display);
  position: sticky;
  top: 24px;
  align-self: start;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 64px clamp(28px, 3.5vw, 56px);
}
.grid a { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
/* Every work sits on a shared bottom line, at its true shape, never cropped */
.grid .frame {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  height: 300px;
  margin-bottom: 16px;
}
.grid img { max-height: 100%; width: auto; transition: opacity 0.2s ease; }
.grid a:hover img { opacity: 0.86; }
.grid cite { font: 400 1.02rem/1.35 var(--serif); font-style: italic; }
.grid a:hover cite { text-decoration: underline; text-underline-offset: 0.2em; }
.grid .meta { margin-top: 4px; font-size: 0.85rem; color: var(--soft); }

/* A single work */
.work { padding-top: clamp(8px, 2vw, 24px); }
.work-art { margin: 0; display: flex; justify-content: center; }
.work-art img { max-height: calc(100vh - 220px); min-height: 0; width: auto; }

.work-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 64px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.caption h1 { margin: 0 0 18px; font: 400 clamp(1.6rem, 3vw, 2.3rem)/1.15 var(--serif); }
.caption dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 28px;
  margin: 0;
  font-size: 0.98rem;
}
.caption dt { color: var(--soft); }
.caption dd { margin: 0; }

.step { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; text-align: right; }
.step a { text-decoration: none; display: block; }
.step a span { display: block; font: 500 0.8rem/1.4 var(--sans); color: var(--soft); }
.step a cite { font: 400 1.05rem/1.3 var(--serif); font-style: italic; }
.step a:hover cite { text-decoration: underline; }
.step .all { font: 500 0.95rem/1 var(--sans); text-decoration: underline; text-underline-offset: 0.35em; margin-top: 6px; }

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 40rem);
  gap: clamp(40px, 7vw, 120px);
  align-items: start;
  padding-top: clamp(24px, 5vw, 72px);
}
.facts img { width: 100%; margin-bottom: 32px; }
.facts dl { margin: 0; display: grid; gap: 16px; }
.facts dt { font-size: 0.85rem; color: var(--soft); }
.facts dd { margin: 2px 0 0; font: 400 1.05rem/1.4 var(--serif); }

.letter h1 { margin: 0 0 8px; font: 400 clamp(2rem, 4vw, 3rem)/1.1 var(--display); }
.letter .context { margin: 0 0 40px; color: var(--soft); }
.letter p { margin: 0 0 1.25em; font: 400 clamp(1.08rem, 1.5vw, 1.2rem)/1.75 var(--serif); }
.letter .context { font-family: var(--sans); font-size: 1rem; line-height: 1.5; }
.letter .signoff { margin-top: 2.2em; font-style: italic; }
.letter .signoff span { display: inline-block; margin-top: 6px; font: 400 2rem/1 var(--display); font-style: normal; }
.letter .more { margin-top: 3em; font: 500 1rem/1 var(--sans); }
.letter .more a { text-underline-offset: 0.35em; }

.notfound { padding-top: 64px; }
.notfound h1 { font: 400 2rem/1.2 var(--display); }

/* Phones and small tablets */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-art { order: -1; justify-self: start; }
  .hero-art img { max-height: 60vh; margin: 0; }
  .year { grid-template-columns: 1fr; gap: 20px; padding-top: 32px; }
  .year h3 { position: static; }
  .work-info { grid-template-columns: 1fr; }
  .step { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 20px 32px; }
  .about { grid-template-columns: 1fr; }
  .facts { order: 2; }
  .facts img { max-width: 320px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 18px; }
  .grid .frame { height: 170px; margin-bottom: 12px; }
  .grid cite { font-size: 0.95rem; }
  .grid .meta { display: none; }
  .work-art img { max-height: 70vh; }
  header.site { padding-top: 22px; padding-bottom: 22px; }
}
