/* ============================================================
   Studio
   1. The opening: one plain statement, a note to scroll, then the
      write-up beside a photograph.
   2. A line in quotation marks, set large.
   3. The team: both founders, then each in turn.
   4. Awards and press, as two plain lists.
   Sizes are set for a 1440px-wide window and grow with wider ones.
   ============================================================ */

.st {
  --u: max(1px, 0.0694444vw);              /* 1 unit = 1px on a 1440 window, larger beyond it */
  --gap: calc(10.6667 * var(--u));         /* gutter of the twelve-column grid */
  --col: calc((100vw - 2 * var(--edge) - 11 * var(--gap)) / 12);
  color: var(--ink);
  font-family: var(--font-display); font-weight: 560; letter-spacing: -0.028em;
  font-kerning: normal; text-rendering: auto;
}

.sa {
  --foot: 20px;                            /* how far the write-up rests above the window's edge */
  padding: calc(250 * var(--u)) var(--edge) 0;
}
.sa-top, .sa-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.sa-top { margin-bottom: calc(54 * var(--u)); }

.sa-title {
  grid-column: 1 / span 7; margin: 0;
  font-size: calc(61.9 * var(--u)); line-height: calc(66 * var(--u)); font-weight: 560; letter-spacing: -0.035em;
}
.sa-hint {
  grid-column: 11 / span 2; align-self: end; justify-self: end; margin: 0;
  font-size: calc(16.5 * var(--u)); line-height: calc(17.6 * var(--u)); white-space: nowrap;
  font-weight: 560; color: rgb(48 38 32 / 0.28);
}

/* the write-up rests at the foot of the window and travels down beside the photograph,
   ending level with the photograph's lower edge */
.sa-copy { grid-column: 1 / span 5; display: flex; align-items: flex-end; }
.sa-text {
  position: sticky; bottom: var(--foot); max-width: calc(449 * var(--u));
  font-size: calc(20.6 * var(--u)); line-height: calc(26 * var(--u));
}
.sa-text p { margin: 0; font-weight: 560; text-wrap: pretty; }

.sa-photo { grid-column: 7 / span 6; margin: 0; }
.sa-frame { position: relative; height: 0; padding-top: 115%; overflow: hidden; background: var(--linen); clip-path: inset(0 0 0 0); }
.sa-frame-in { position: absolute; inset: 0; }
.sa-pic { position: absolute; left: 0; top: -10%; width: 100%; height: 120%; will-change: transform; }
.sa-pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.sa-frame canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; touch-action: pan-y;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.sa-frame.is-live canvas { opacity: 1; }

/* ---------- 2. the quoted line: full width, its first line set in by two columns ---------- */
.sq { padding: calc(150 * var(--u)) var(--edge); }
.sq-text {
  --indent: calc(2 * var(--col) + 2 * var(--gap));
  margin: 0; text-indent: var(--indent);
  font-size: calc(74.2 * var(--u)); line-height: calc(78 * var(--u)); font-weight: 560; letter-spacing: -0.038em;
}
.sq-text .ln { text-indent: 0; }
.sq-text .ln:first-child { margin-left: var(--indent); }

/* ---------- 3. the team ----------
   Small windows and reduced motion: the photograph of both fills a screen, then each
   founder follows with words and a portrait.
   Larger windows: the section holds still for three and a half screens of scrolling.
   The photograph of both fills the window and draws back into a frame on the right while
   the label travels down to rest above the words; each portrait then wipes up over the
   last, and the words on the left rise and leave in step with it. */
.sl {
  display: flex; gap: calc(10 * var(--u)); margin: 0;
  font-size: calc(14.4 * var(--u)); line-height: calc(16.8 * var(--u)); font-weight: 560; letter-spacing: -0.02em; text-transform: uppercase;
}
.sl span { color: rgb(48 38 32 / 0.28); }

.sm-stage { position: relative; }
.sm-cover { position: relative; height: 100svh; min-height: 480px; margin: 0; overflow: hidden; background: var(--linen); }
.sm-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.sm-shade { position: absolute; inset: 0; background: rgb(var(--shade)); opacity: 0; pointer-events: none; }
.sm-label { position: absolute; z-index: 2; top: calc(var(--header-h) + 8px); left: var(--edge); }   /* on the photograph */
.sm-left { padding: 100px var(--edge); }
.sm-cards { display: flex; flex-direction: column; gap: 68px; }
.sm-name { margin: 0 0 32px; font-size: 37.1px; line-height: 39.6px; font-weight: 560; letter-spacing: -0.035em; }
.sm-bio { font-size: 16.5px; line-height: 19.8px; --d: 0.12s; }
.sm-bio p { margin: 0; font-weight: 560; }
.sm-role { color: rgb(48 38 32 / 0.4); }
.sm-bio p + p { margin-top: 0.35em; }
.sm-shot { position: relative; height: 0; margin-top: 32px; padding-top: 126%; overflow: hidden; background: var(--linen); }
.sm-shot img, .sm-shot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sm-shot img { object-fit: cover; }
.sm-shot canvas { opacity: 0; }
.sm-shot.is-live canvas { opacity: 1; }

@media (min-width: 768px) and (min-height: 560px) and (prefers-reduced-motion: no-preference) {
  html.js .sm { height: 450vh; }
  html.js .sm-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
  html.js .sm-stage {
    display: flex; align-items: flex-end; height: 100%;
    --k: 0;                                                        /* 0 = fills the window, 1 = in its frame */
    --frame-l: calc(var(--edge) + 7 * (var(--col) + var(--gap)));  /* the frame starts at the eighth column */
    /* the frame stands at the foot of the window; on a tall, narrow screen it stops growing once
       it is about one and a half times as tall as it is wide, so a portrait is never squeezed */
    --frame-h: min(calc(100svh - var(--header-h) - 20px), calc((5 * var(--col) + 4 * var(--gap)) * 1.46));
    --frame-t: calc(100svh - 20px - var(--frame-h));
  }
  html.js .sm-cover {
    position: absolute; height: auto; min-height: 0;
    top: calc(var(--k) * var(--frame-t)); right: calc(var(--k) * var(--edge));
    bottom: calc(var(--k) * 20px); left: calc(var(--k) * var(--frame-l));
  }
  html.js .sm-cover img { object-position: 50% calc(16.4% + var(--k) * 33.6%); }
  html.js .sm-shade { opacity: var(--dim, 0); }

  /* the words rest at the foot of the left five columns; nothing here is positioned, so each
     portrait inside its card can be placed against the whole window */
  html.js .sm-left { width: calc(5 * var(--col) + 4 * var(--gap)); margin: 0 0 20px var(--edge); padding: 0; }
  /* the label rests above the words; while the photograph fills the window it is lifted to the
     top left, and it comes down with the scroll */
  html.js .sm-label { position: relative; top: auto; left: auto; margin-bottom: calc(52 * var(--u)); transform: translate3d(0, var(--lift, 0px), 0); }
  html.js .sm-cards { display: grid; gap: 0; }
  html.js .sm-card { grid-area: 1 / 1; align-self: end; }
  html.js .sm-name { margin-bottom: 24px; font-size: 49.5px; line-height: 52.8px; }
  html.js .sm-bio { --j: 1; }
  /* each line follows the scroll: it rises as its portrait comes up (--r) and leaves upward
     as the next one does (--o), one line a little after another */
  html.js #team .sm-card .ln-in {                             /* by id: this must outrank the page's arriving rules */
    transition: none;
    transform: translateY(calc((1 - clamp(0, var(--r, 0) * 1.7 - (var(--i, 0) + var(--j, 0)) * 0.08, 1)) * 112% - var(--o, 0) * 112%));
  }

  /* each portrait sits in the frame and is uncovered from its foot */
  html.js .sm-shot {
    position: absolute; top: var(--frame-t); right: var(--edge); bottom: 20px; left: var(--frame-l);
    height: auto; margin: 0; padding: 0;
    clip-path: inset(calc((1 - var(--w, 0)) * 100%) 0 0 0);
  }
  /* the header steps back while the section holds the window */
  .hd.is-over { background: transparent; }
}
@media (min-width: 1024px) and (min-height: 560px) and (prefers-reduced-motion: no-preference) {
  html.js .sm-name { margin-bottom: calc(24 * var(--u)); font-size: calc(61.9 * var(--u)); line-height: calc(66 * var(--u)); }
  html.js .sm-bio { font-size: calc(20.6 * var(--u)); line-height: calc(26 * var(--u)); }
}

/* ---------- 4. awards and press ----------
   Lists in the same manner as the index on the Work page: small spaced headings, one fine
   rule under each row. Every row is a link; under the pointer it becomes a solid band. */
.si { padding: calc(150 * var(--u)) var(--edge) 0; letter-spacing: normal; }
.si-list { margin: calc(52 * var(--u)) calc(-1 * var(--edge)) 0; font-family: var(--font-body); }
.si-list ul { margin: 0; padding: 0; list-style: none; }
.si-row {
  display: grid; grid-template-columns: 80px 1.5fr 1fr 220px; gap: 24px; align-items: baseline;
  padding: 26px var(--edge); color: inherit; text-decoration: none;
  background: linear-gradient(var(--sand), var(--sand)) var(--edge) 100% / calc(100% - 2 * var(--edge)) 0.5px no-repeat;
}
.si-head { padding-top: 0; padding-bottom: 20px; font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
a.si-row .si-year { font-size: 12px; font-weight: 300; letter-spacing: 0.04em; }
a.si-row .si-title { font-size: 13px; font-weight: 400; letter-spacing: 0.02em; }
a.si-row .si-mid { font-size: 12px; font-weight: 300; letter-spacing: 0.02em; }
a.si-row .si-by { font-size: 11px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.si-row .si-by { text-align: right; }
a.si-row:focus-visible { outline: 2px solid; outline-offset: -2px; }
/* the band and its light text arrive together, at once: a fade would pass through a moment
   where the words and the band are the same tone */
@media (hover: hover) and (pointer: fine) {
  a.si-row:hover { background: var(--ink); color: var(--paper); }
}
@media (max-width: 1023px) {
  .si-row { grid-template-columns: 60px 1.5fr 1fr 150px; gap: 16px; }
}
@media (max-width: 767px) {
  .si { padding-top: 100px; }
  .si-list { margin-top: 40px; }
  .si-row { grid-template-columns: 50px 1fr; gap: 6px 12px; padding-top: 20px; padding-bottom: 20px; }
  .si-head { padding-top: 0; }
  .si-row .si-mid, .si-head .si-by { display: none; }
  .si-row .si-by { grid-column: 2; text-align: left; }
}

/* ---------- arriving: lines climb into place, the photograph opens from its foot ----------
   Only when the page is opened directly. Arriving from another page, behind its name card,
   everything is already in place as the card lifts (html.has-card, then .is-still). */
.is-still, .is-still * { transition: none !important; }
.ln { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.ln-in { display: block; }
.wd { white-space: nowrap; }
html.js:not(.rise-off):not(.has-card) [data-arrive]:not(.is-set) [data-lines] { visibility: hidden; }
html.js:not(.rise-off):not(.has-card) [data-arrive]:not(.is-in) .ln-in { transform: translateY(112%); }
html.js:not(.rise-off):not(.has-card) .sa:not(.is-in) .sa-hint { opacity: 0; }
html.js:not(.rise-off):not(.has-card) .sa:not(.is-in) .sa-frame { clip-path: inset(50% 35% 0 35%); }
html.js:not(.rise-off):not(.has-card) .sa:not(.is-in) .sa-frame-in { transform: scale(0.95); }
[data-arrive].is-in .ln-in { transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--d, 0s) + var(--i, 0) * 0.1s); }
.sa.is-in .sa-hint { transition: opacity 0.8s var(--ease-out) 0.7s; }
.sa.is-in .sa-frame { transition: clip-path 1.4s cubic-bezier(0.16, 1, 0.3, 1); }
.sa.is-in .sa-frame-in { transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1); }
.sa-title { --d: 0.15s; }
.sa-text { --d: 0.5s; }

/* ---------- short windows: less empty space above the statement ---------- */
@media (max-height: 560px) {
  .sa { padding-top: 120px; }
}

/* ---------- smaller windows ---------- */
@media (max-width: 1023px) {
  .sa-title { grid-column: 1 / span 8; font-size: 49.5px; line-height: 52.8px; }
  .sq-text { font-size: 49.5px; line-height: 56px; }
}
@media (max-width: 767px) {
  .sa { --foot: 0px; }
  .sq { padding-top: 100px; padding-bottom: 100px; }
  .sq-text { --indent: 0px; line-height: 52.8px; }
  .sa-top { margin-bottom: 0; }
  .sa-title { grid-column: 1 / -1; font-size: 37.1px; line-height: 39.6px; }
  .sa-hint { display: none; }
  .sa-copy { grid-column: 1 / -1; order: 2; }
  .sa-text { position: static; max-width: none; }
  .sa-photo { grid-column: 1 / -1; margin: 32px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sa-frame canvas { display: none; }
  .sa-pic { top: 0; height: 100%; }
}
