/* Materials — TailsUp's five films: the heading with the four vertical films rising left to right under it (the lead in
   the room the first film leaves), then the 16:9 Mac film across the page on the deeper stock. Load after tokens.css
   and site.css; behaviour in /assets/js/materials.js. Mobile first; two columns from 600 px; the 12-column grid from
   900 px. */

/* ---------- 1. opener: the heading and the vertical films ---------- */
.mo { padding: calc(var(--hdr) + clamp(28px, 5vh, 56px)) 0 var(--sec); }
.mo-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.mo-h { font-family: var(--serif); font-weight: 400; font-size: var(--t-h1); line-height: .94; letter-spacing: -.014em; }
.mo-lead { margin-top: 18px; max-width: 28ch; }

/* phones: one film after another, alternately set left and right */
.mf { width: min(80%, 340px); margin-top: 56px; display: grid; align-content: start; gap: 18px; }
.mo-lead + .mf { margin-top: 44px; }
.mf:nth-of-type(even) { justify-self: end; }
.mf .rec-frame { aspect-ratio: 9 / 16; box-shadow: 0 30px 60px -36px rgba(11, 11, 12, .5); }
.mf-t { font-size: clamp(20px, 1.55vw, 23px); font-weight: 500; line-height: 1.15; letter-spacing: -.025em; text-wrap: balance; }
.mf-l { margin-top: 6px; max-width: 34ch; font-size: 15px; line-height: 1.5; color: var(--ink-soft); letter-spacing: -.008em; text-wrap: pretty; }
.mf-tag { margin-top: 10px; font-size: 12px; line-height: 1.4; color: var(--ink-mute); letter-spacing: 0; }

@media (min-width: 600px) and (max-width: 899.98px) {
  .mo-grid { grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
  .mo-h, .mo-lead { grid-column: 1 / -1; }
  .mf, .mo-lead + .mf { width: auto; margin-top: 56px; justify-self: stretch; }
  .mf:nth-of-type(even) { margin-top: 160px; }
  .mf:nth-of-type(3) { margin-top: -48px; }
  .mf:nth-of-type(4) { margin-top: 56px; }
}

/* from 900 px: the films on columns 1–3, 4–6, 7–9 and 10–12, each a step higher than the one before */
@media (min-width: 900px) {
  .mo-grid { grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: start; --top: clamp(40px, 3.6vw, 64px); --rise: clamp(56px, 6.6vw, 120px); }
  .mo-h { grid-column: 1 / -1; grid-row: 1; }
  .mo-lead { grid-column: 1 / span 4; grid-row: 2; margin-top: var(--top); padding-right: 16px; }
  .mf, .mo-lead + .mf { grid-row: 2; width: auto; justify-self: stretch; margin-top: calc(var(--top) + var(--rise) * var(--k)); }
  .mf:nth-of-type(1) { grid-column: 1 / span 3; --k: 3; }
  .mf:nth-of-type(2) { grid-column: 4 / span 3; --k: 2; }
  .mf:nth-of-type(3) { grid-column: 7 / span 3; --k: 1; }
  .mf:nth-of-type(4) { grid-column: 10 / span 3; --k: 0; }
  .mf { gap: 20px; }
}

/* ---------- 2. the Mac film across the page, on the deeper stock ---------- */
.mw { background: var(--paper-2); padding: var(--sec) 0; }
.mw-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.mw-side { margin-top: 14px; }
.mw-side .mf-l { margin-top: 0; max-width: 32ch; font-size: var(--t-lead); line-height: 1.45; letter-spacing: -.012em; }
.mw-rec { margin: 40px calc(var(--m) * -1) 0; }
.mw-rec .rec-frame { aspect-ratio: 16 / 9; border-radius: 0; }
@media (min-width: 900px) {
  .mw-grid { grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: end; }
  .mw-h { grid-column: 1 / span 7; }
  .mw-side { grid-column: 9 / span 4; margin: 0; padding-bottom: .3em; }
  /* as wide as the page, short enough to sit whole under the header */
  .mw-rec { grid-column: 1 / -1; justify-self: center; width: min(100%, calc((100svh - var(--hdr) - 48px) * 16 / 9)); margin: clamp(40px, 4.4vw, 72px) 0 0; }
  .mw-rec .rec-frame { border-radius: var(--r-s); box-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 40px 80px -40px rgba(11, 11, 12, .45); }
}
