/* morganbeckwith.com
   Every non-artwork color is one hue: the magenta of the paint blob (~325deg). */

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #fdf9fb;
  --ink: #2b1421;
  --muted: #806574;
  --line: #ead9e2;
  --paint: #a3106a;
  --hh: 4rem;          /* header height */
  --m: 1rem;           /* page margin */
  /* One width for every painting: as wide as the screen allows, limited so a
     typical upright piece (about 4:5) fills the screen top to bottom. */
  --pw: min(100vw - 2 * var(--m), max((100svh - var(--hh) - 5.5rem) * 0.7, 18rem));
}
@media (min-width: 48rem) {
  :root { --hh: 5.25rem; --m: 2rem; }
}

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

html {
  font-size: 112.5%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.5;
  font-feature-settings: "kern", "liga", "onum";
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--paint);
  outline-offset: 3px;
}

/* ---- header ---- */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--hh);
  padding: 0 var(--m);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--paper);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  min-width: 0;
}
.brand picture { flex: none; }
.blob { height: 2.25rem; width: auto; max-width: 42vw; object-fit: contain; }
.name, .top nav a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-feature-settings: "kern", "lnum";
}
.name { line-height: 1.35; word-spacing: 100vw; }   /* two lines on phones */
.top nav { display: flex; gap: 1.1rem; }
.top nav a {
  text-decoration: none;
  padding: 0.9rem 0;                 /* tall tap target */
  color: var(--muted);
  transition: color 0.2s;
}
.top nav a:hover { color: var(--paint); }
.top nav a[aria-current] { color: var(--paint); }
@media (max-width: 21rem) {           /* 320px phones */
  .blob { height: 1.8rem; }
  .brand { gap: 0.45rem; }
  .name, .top nav a { letter-spacing: 0.1em; }
  .top nav { gap: 0.75rem; }
}
@media (min-width: 30rem) {
  .blob { height: calc(var(--hh) - 1rem); }
  .name { word-spacing: normal; font-size: 0.9rem; letter-spacing: 0.2em; }
  .top nav a { font-size: 0.85rem; letter-spacing: 0.2em; }
  .top nav { gap: 2.2rem; }
}

/* ---- sections ----
   data-view on <html> decides what is on screen:
   "home"      the whole site as one long scroll (Home, Paintings, Bio);
   "paintings" or "bio"   that page alone, opened from the menu or by address.

   In the long scroll each section scrolls away normally and is followed by
   blank space (--gap) before the next one arrives. */
:root {
  --photo-h: calc(100svh - var(--hh) - var(--m));
  --gap: var(--photo-h);
}
.stage { padding-bottom: var(--gap); }

html[data-view="paintings"] .stage-home,
html[data-view="paintings"] #bio,
html[data-view="bio"] .stage { display: none; }
html[data-view="paintings"] .stage-paintings { padding-bottom: 0; }
html[data-view="paintings"] #paintings,
html[data-view="bio"] #bio { animation: arrive 0.3s ease-out; }
@keyframes arrive { from { opacity: 0; } }
html { scrollbar-gutter: stable; }

.home {
  height: 100svh;
  padding: var(--hh) var(--m) var(--m);
}
.home picture, .home img { width: 100%; height: 100%; }
.home img { object-fit: cover; }
.home.whole img { object-fit: contain; }

.paintings {
  padding: calc(var(--hh) + 1rem) var(--m) 1px;
}
.piece {
  width: var(--pw);
  margin: 0 auto 22svh;
}
.piece:last-child { margin-bottom: 14svh; }
.piece img { width: 100%; }
.piece figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.9rem;
  padding-top: 0.8rem;
  line-height: 1.35;
}
.piece .label { font-style: italic; font-size: 1.05rem; }
.piece .facts { color: var(--muted); font-size: 0.9rem; }

.bio {
  min-height: 100svh;
  padding: calc(var(--hh) + 1rem) var(--m) 4rem;
}
.bio-inner { max-width: 60rem; margin: 0 auto; }
.band img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
@media (min-width: 48rem) {
  .band img { aspect-ratio: 3 / 1; }
}
.band.whole img { aspect-ratio: auto; }
.text {
  max-width: 34rem;
  margin: 3.5rem auto;
  font-size: 1.15rem;
  line-height: 1.6;
  hanging-punctuation: first;
}
.text p { margin: 0 0 1.1em; }
.contact-link {
  margin: 3.5rem 0 0;
  text-align: center;
}
.contact-link a, .button {
  display: inline-block;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--paint);
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.9rem 0.8rem 2.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.contact-link a:hover, .button:hover { background: #870a57; }

/* ---- contact page ---- */
.field .notice { margin: 0.6rem 0 0; padding: 0.4rem 0.8rem; font-size: 0.95rem; }
.contact {
  padding: calc(var(--hh) + 1rem) var(--m) 4rem;
}
.contact-inner { max-width: 60rem; margin: 0 auto; }
.form-wrap { max-width: 30rem; margin: 3rem auto 0; }
.form-wrap h1 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.form-wrap .lede { margin: 0 0 2.2rem; color: var(--muted); font-size: 1.05rem; }
.field { margin-bottom: 1.6rem; }
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--muted);
  border-radius: 0;
  padding: 0.45rem 0;
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-bottom: 2px solid var(--paint); padding-bottom: calc(0.45rem - 1px); }
.trap { position: absolute; left: -100vw; width: 1px; height: 1px; overflow: hidden; }
.notice { margin: 0 0 2rem; padding: 0.9rem 1.1rem; border-left: 3px solid var(--paint); background: #f8eef3; }
.sent { font-size: 1.25rem; line-height: 1.5; }
.sent a { color: var(--paint); }

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