/* stefanopasseri.com
   One centered column, 920px at most. Text kept to a reading length inside it.
   Used by the home page, Info and the current project pages.
   (The older, unlisted project pages still use main.css.) */

:root {
  --paper: #efeeec;
  --ink: #1a1a1a;
  --mute: #6b6a64;
  --rule: #cfcdc7;
  --wait: #e4e3df;
  --font: 'Work Sans', 'Helvetica Neue', Arial, sans-serif;
  /* the cursor: a small vertical blp with a white edge, pointing from its top end */
  --blp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='32' viewBox='0 0 18 32'%3E%3Crect x='3' y='3' width='12' height='26' rx='6' fill='%23141414' stroke='%23ffffff' stroke-width='2'/%3E%3C/svg%3E") 9 3;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; cursor: var(--blp), pointer; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
img, video { max-width: 100%; }

/* page frame */
.site { padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); padding-block: 10px 120px; }
.site > * { max-width: 920px; margin-left: auto; margin-right: auto; }

/* header: name, then Info. In place at the top; scrolling down hides it, scrolling up brings it back */
.top { font-size: 19px; display: flex; gap: 2rem; align-items: baseline;
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper);
  padding-block: 12px; transition: transform 0.35s ease; }
.top.away { transform: translateY(calc(-100% - env(safe-area-inset-top, 0px))); }
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); z-index: 11; background: var(--paper); }
.top a:hover { color: var(--mute); }
.top a[aria-current="page"] { color: var(--mute); }
main { padding-top: 56px; }

.y { color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* name: on hover the letters sag a pixel or two, unevenly, and recover */
.name .ch { display: inline-block; transition: transform 1.6s cubic-bezier(.3,.7,.2,1); }
.name:hover .ch { transform: translateY(var(--d, 1px)); transition-duration: 0.9s; }

/* home: the list of works, set large, years small beside them */
.tindex { list-style: none; padding-top: 12px; }
.tindex li + li { margin-top: 0.55em; }
.tindex a { display: inline-flex; align-items: baseline; gap: 0.9rem; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.2; letter-spacing: -0.01em; }
.tindex .ty { font-size: 15px; letter-spacing: 0; color: var(--mute); font-variant-numeric: tabular-nums; }
.tindex a:hover .tt { color: var(--mute); }

/* home picture. With a pointer: pointing at a title opens that work's clip (or photo) just under it,
   behind the rest of the list, in a fixed 3:2 frame so nothing moves. Titles flip light where they
   cross a dark picture (difference blend; on the plain page they look as before).
   On touch screens: one photo under the list, chosen at random on each visit. */
.pick { margin-top: 48px; max-width: 40rem; }
.pick img, .pick video { width: 100%; display: block; }
.pick figcaption { margin-top: 8px; font-size: 14px; color: var(--mute); }
.home .pick.hov { position: absolute; margin: 0; width: 44rem; max-width: 100%; aspect-ratio: 3 / 2; pointer-events: none; z-index: 0; }
.pick.hov img, .pick.hov video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; object-position: left top; }
@media (hover: hover) and (pointer: fine) {
  .home { position: relative; }
  .home .tindex { position: relative; z-index: 1; mix-blend-mode: difference; }
  .home .tindex .tt, .home .tindex a:hover .tt { color: #d5d4d2; }
  .home .tindex .ty { color: #848488; }
}

/* thumbnails (no longer on the home page; kept for any page that still uses them) */
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--wait); }
.thumb img, .thumb video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
@supports not (aspect-ratio: 16 / 9) {
  .thumb { height: 0; padding-top: 56.25%; }
  .grid img, .grid video { height: auto; }
  .home .pick.hov { height: 0; padding-top: 66.67%; }
}

/* project pages */
.ptitle { margin-bottom: 24px; }
.fig { margin-bottom: 14px; }
.fig img, .fig video { width: 100%; display: block; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.free { align-items: start; }
.grid.free img { aspect-ratio: auto; object-fit: initial; }
.grid img, .grid video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.stack { display: grid; gap: 5px; margin-bottom: 14px; }
.stack img { width: 100%; display: block; }
.cap { font-size: 14px; color: var(--mute); margin: -2px 0 44px; }
.cap p { max-width: 60em; }
/* label: tombstone on the left, the paragraph set over to the right edge of the column (still left-aligned) */
.label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 34rem); column-gap: 3rem; padding-block: 28px 48px; border-top: 1px solid var(--rule); margin-top: 30px; }
.tomb { max-width: 21rem; }
.tomb .m { display: block; margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--mute); }
.text { max-width: 36em; }
.text p + p { margin-top: 1em; }
.next { border-top: 1px solid var(--rule); padding-top: 18px; display: flex; justify-content: space-between; gap: 1rem; color: var(--mute); }
.next a:hover { color: var(--ink); }
.p5row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.p5c canvas { width: 100% !important; height: auto !important; display: block; }

/* info */
.contact { margin-bottom: 40px; display: flex; gap: 1.5rem; }
.contact a { text-decoration: underline; text-underline-offset: 3px; }
.contact a:hover { color: var(--mute); }
.info h2 { font-size: 16px; font-weight: 500; letter-spacing: 0.01em; margin: 36px 0 10px; }
.info ul { list-style: none; border-top: 1px solid var(--rule); }
.info li { display: grid; grid-template-columns: 6.5rem minmax(0, 44rem); column-gap: 1.5rem; padding-block: 7px; border-bottom: 1px solid var(--rule); }

/* idle: after a long while with no input, one image sinks 2px and stays */
.settle { transform: translateY(2px); transition: transform 9s ease-in; }

@media (max-width: 1000px) and (min-width: 701px) {
  .label { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 2rem; }
}
@media (max-width: 700px) {
  .label { grid-template-columns: minmax(0, 1fr); row-gap: 22px; }
  .tomb { max-width: none; }
  .site { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 6px 80px; }
  main { padding-top: 36px; }
  .grid.three, .p5row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info li { grid-template-columns: 5.5rem minmax(0, 1fr); column-gap: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .top { transition: none; }
  .name .ch, .name:hover .ch { transform: none; transition: none; }
  .settle { transform: none; transition: none; }
}
