/*
  index-2: moving through scenes.
  A fixed stage of full-screen photographs; the page scrolls over it and
  journey.js cross-fades and slowly pushes the camera through each one.
*/

/* ---------- the site's two text sizes for reading, shared by every page ----------
   --text-read: long passages (the writings, About, the answers to Questions).
   --text-side: what sits beside them (side notes, the lists of parts, the shelf of writings, polaroid captions).
   --text-call: the large centred callouts.
   --text-closing / --text-attrib: the quotations and closing words over photographs, and who said them. */
:root {
  --text-read: clamp(1.22rem, 1.08rem + .5vw, 1.42rem);
  --text-read-lh: 1.66;
  --text-side: 1.06rem;
  --text-side-lh: 1.5;
  /* the large centred callouts within a passage (About's, and the writings' pull quotes) */
  --text-call: clamp(1.45rem, 1.1rem + 1.3vw, 2.15rem);
  --text-call-lh: 1.3;
  --text-call-measure: 26ch;
  /* how wide a long passage runs: the writings and About */
  --text-measure: 42rem;
  /* the large closing words over a photograph: the homepage's poem and every footer's closing line */
  --text-closing: clamp(1.8rem, 1.1rem + 2vw, 3rem);
  /* and who said them, beneath: a dash, the name upright, a work's title in italics */
  --text-attrib: clamp(1.3rem, 1.05rem + .95vw, 2rem);
}

.journey { color: var(--paper); }

/* ---------- the stage ---------- */
.stage { display: none; }
.js .stage {
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--sky-0-top);
}
.stage__layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
}
.stage__layer:first-child { opacity: 1; visibility: visible; }
.stage__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  will-change: transform;
}
.stage__layer--video {
  background: linear-gradient(180deg, var(--sky-0-top), var(--sky-0-bottom));
}
.stage__layer--video video { opacity: 0; transition: opacity 2200ms var(--ease-soft); }
.stage__layer--video.is-playing video { opacity: 1; }
.stage__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(16 21 27 / .34), rgb(16 21 27 / .2) 45%, rgb(16 21 27 / .4));
}

/* ---------- scenes ---------- */
.scene {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 175vh;
  padding: 0 var(--gutter);
}
.no-js .scene,
.no-js .invites {
  min-height: 100vh;
  background: linear-gradient(rgb(16 21 27 / .42), rgb(16 21 27 / .42)), var(--img) center / cover no-repeat;
}
.no-js .scene--hero { background: linear-gradient(180deg, var(--sky-0-top), var(--sky-0-bottom)); }

.scene--hero { min-height: 170vh; justify-items: center; align-items: start; }
.scene__title {
  position: sticky;
  top: 34vh;
  margin-top: 34vh;
  max-width: 16ch;
  font-size: clamp(2.3rem, 1.25rem + 4.7vw, 5.4rem);
  line-height: 1.07;
  letter-spacing: -.012em;
  text-align: center;
  text-shadow: 0 2px 34px rgb(16 21 27 / .62);
}
.scene__title > span { display: block; }
.scene__title-second { font-style: italic; }

.scene__line {
  position: relative;
  max-width: 19ch;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: clamp(2rem, 1.2rem + 3.4vw, 4.4rem);
  line-height: 1.14;
  letter-spacing: -.01em;
  text-shadow: 0 2px 30px rgb(16 21 27 / .75), 0 0 80px rgb(16 21 27 / .5);
}
.scene.is-left { justify-items: start; }
.scene.is-center { justify-items: center; text-align: center; }
.scene.is-right { justify-items: end; }
.scene--breath { min-height: 150vh; }
.scene--last { min-height: 110vh; }

/* ---------- hover blur, letter by letter ---------- */
.bt-word { display: inline-block; white-space: nowrap; }
.bt-char {
  display: inline-block;
  transition: filter 240ms ease-out, opacity 240ms ease-out;
}
/* split in place (lines with their own markup): inline, so underlines carry through */
.bt-word--in { display: inline; }
.bt-char--in { display: inline; }

/* ---------- invitations: moves right to left as you scroll ---------- */
.invites { position: relative; }
.invites__pin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1rem, 3.5vh, 2.5rem);
  min-height: 100vh;
  min-height: 100svh;
  padding: 11vh 0 6vh;
  overflow: hidden;
}
.invites.is-pinned .invites__pin { position: sticky; top: 0; height: 100vh; height: 100svh; }
.invites__title {
  padding: 0 var(--gutter);
  font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4.6rem);
  line-height: 1.05;
  text-shadow: 0 2px 30px rgb(16 21 27 / .7);
}
.invites__track {
  display: flex;
  gap: clamp(1rem, 3vw, 2.75rem);
  padding: 0 var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.invites__track::-webkit-scrollbar { display: none; }
.invites.is-pinned .invites__track {
  width: max-content;
  overflow: visible;
  will-change: transform;
}
.invite {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  width: min(80vw, 31rem);
  height: min(66vh, 40rem);
  border-radius: var(--radius-soft);
  overflow: hidden;
  color: var(--paper);
  text-decoration: none;
  scroll-snap-align: center;
  background: rgb(16 21 27 / .32);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .invite {
    -webkit-backdrop-filter: blur(var(--card-blur));
    backdrop-filter: blur(var(--card-blur));
  }
}
.invite__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(120% 110% at 50% 45%, #000 55%, transparent 100%);
  mask-image: radial-gradient(120% 110% at 50% 45%, #000 55%, transparent 100%);
  transition: transform 1400ms var(--ease-soft);
}
.invite::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 38%, rgb(16 21 27 / .74) 100%);
}
@media (hover: hover) and (pointer: fine) {
  .invite:hover .invite__img { transform: scale(1.05); }
}
.invite__text {
  position: relative;
  z-index: 1;
  display: block;
  padding: clamp(1.25rem, 3vw, 2.25rem);
}
.invite__name {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: clamp(2.4rem, 1.8rem + 2.4vw, 3.9rem);
  line-height: 1.05;
}
.invite__summary { display: block; margin-top: .6rem; font-size: 1rem; line-height: 1.5; }

/* ---------- blog ---------- */
.scene--blog {
  display: block;
  padding: 26vh var(--gutter) 60vh;
}
.blog__title {
  max-width: 72rem;
  margin: 0 auto clamp(2.5rem, 8vh, 5rem);
  font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4.6rem);
  text-shadow: 0 2px 30px rgb(16 21 27 / .7);
}
/* Loose prints: photographs left on a table */
.prints {
  display: grid;
  gap: 2.5rem;
  justify-items: center;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.print {
  max-width: 25rem;
  padding: .85rem .85rem 1.5rem;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 26px 70px rgb(16 21 27 / .42);
  transition: rotate 900ms var(--ease-soft), translate 900ms var(--ease-soft), scale 900ms var(--ease-soft);
}
.print:nth-child(1) { rotate: -3deg; }
.print:nth-child(2) { rotate: 2.2deg; }
.print:nth-child(3) { rotate: -1.4deg; }
.print__link { display: block; color: inherit; text-decoration: none; }
.print__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: .85rem;
}
.print__name {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: clamp(1.5rem, 1.25rem + .9vw, 2.1rem);
  line-height: 1.15;
}
.print__excerpt {
  display: block;
  margin-top: .55rem;
  font-size: 1rem;
  line-height: 1.55;
}
@media (min-width: 900px) {
  .prints { grid-template-columns: repeat(3, 1fr); gap: 0; align-items: start; }
  .print:nth-child(1) { margin-right: -1.5rem; }
  .print:nth-child(2) { position: relative; z-index: 1; margin-top: 3.5rem; }
  .print:nth-child(3) { margin-left: -1.5rem; margin-top: 1rem; }
}
@media (hover: hover) and (pointer: fine) {
  .print:hover { position: relative; z-index: 2; rotate: 0deg; scale: 1.04; translate: 0 -8px; }
}
.print:focus-within { position: relative; z-index: 2; rotate: 0deg; }

/* ---------- closing ---------- */
.journey .site-footer {
  margin-top: -60vh;
  background: linear-gradient(180deg, transparent, rgb(16 21 27 / .62) 34%, rgb(16 21 27 / .8));
  color: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
  .stage__media { will-change: auto; }
  .bt-char { transition: none; }
  .invite__img { transition: none; }
  .print { transition: none; }
}

/* ---------- a page's opening photograph emerges as the page opens ([data-emerge]): out of the page's light, from a
   soft blur, settling slightly as it comes clear. journey.js waits for its pictures to load (a few seconds at most). */
@keyframes emerge-in { from { opacity: 0; filter: blur(18px); } }
@keyframes emerge-settle { from { transform: scale(1.035); } }
.js [data-emerge] { opacity: 0; }
.js [data-emerge].is-emerged { opacity: 1; animation: emerge-in 2600ms cubic-bezier(.22, .61, .36, 1) both; }
/* a picture that is the whole of its frame settles inside it, so nothing reaches past the edge of the screen */
.js [data-emerge].is-emerged > img { animation: emerge-settle 2600ms cubic-bezier(.22, .61, .36, 1) both; }
.wa-fig__frame[data-emerge] { overflow: clip; }
@media (prefers-reduced-motion: reduce) {
  .js [data-emerge].is-emerged { animation: emerge-fade 900ms ease-out both; }
  .js [data-emerge].is-emerged > img { animation: none; }
}
@keyframes emerge-fade { from { opacity: 0; } }

/* the footer's "Serving joy that waits in thresholds." is a quiet link to that part of About */
.site-footer__role-a { color: inherit; text-decoration: none !important; }   /* no line at rest, anywhere. (Not positioned: a positioned link drops out of the line's glowing text, which then shows nothing; its hairline measures from the line itself) */
.site-footer__role { position: relative; }
/* with a mouse, a fine, translucent line fades in right along the foot of the words while they're hovered. It is a shadow
   inside the words' own box (not a text underline, which Safari placed oddly under the line's glow, and not a positioned
   line, which dropped the words out of the line's glowing text) */
@media (hover: hover) and (pointer: fine) {
  .site-footer__role-a { box-shadow: inset 0 -1px 0 rgb(243 237 227 / 0); transition: box-shadow 500ms var(--ease-soft); }
  .site-footer__role-a:hover, .site-footer__role-a:focus-visible { box-shadow: inset 0 -1px 0 rgb(243 237 227 / .38); }
  :root[data-theme="light"] .wb-page .site-footer__role-a:hover, :root[data-theme="light"] .wb-page .site-footer__role-a:focus-visible { box-shadow: inset 0 -1px 0 rgb(31 36 42 / .32); }   /* Writing's light footer: dark ink */
}
/* ---------- the breadcrumb on every subpage (Home / About, Home / Writing, ...): where you are, and the way back ---------- */
.ab-crumb { display: flex; align-items: center; gap: .7rem; margin: 0 0 clamp(1.2rem, 3vh, 2rem); font-family: var(--font-body, inherit); font-size: 1rem; letter-spacing: .16em; text-transform: uppercase; text-shadow: none; }
.ab-crumb__home { display: inline-flex; align-items: center; gap: .55rem; color: inherit; opacity: .78; text-decoration: none; transition: opacity 500ms var(--ease-soft); }
.ab-crumb__home svg { width: 22px; height: 11px; transition: translate 600ms var(--ease-soft); }
.ab-crumb__home:hover, .ab-crumb__home:focus-visible { opacity: 1; }
.ab-crumb__home:hover svg { translate: -4px 0; }
.ab-crumb__sep { opacity: .4; }
.ab-crumb__here { opacity: 1; }
