/* Home version C feature board: each film on a white card on the cork. assets/feature-videos.js places the notes
   (scaled whole with transforms, so films keep their shape) and brings them in as the page scrolls. */
/* Type is set for the card's base width; two by two the cards draw at about 0.8, so 30/20px read as about 24/16px. */
.c-nf { position: relative; width: 720px; max-width: 100%; box-sizing: border-box; padding: 0 14px 14px; border-radius: 18px; background: var(--paper); box-shadow: var(--rim), var(--lift); }
/* Depth, lit from above: a rim (a bright top edge, a darker bottom one: the card's thickness) and three shadows on the cork,
   a tight contact shadow, a key shadow and a soft ambient one. As a card rises the contact shadow fades and the others reach further. */
.c-nf {
  --rim: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1.5px 0 rgba(70, 40, 10, .08), 0 0 0 1px rgba(70, 40, 10, .1);
  --lift: 0 1px 1.5px rgba(40, 18, 0, .30), 0 7px 12px -3px rgba(40, 18, 0, .28), 0 26px 39px -12px rgba(40, 18, 0, .57);
}
.c-nf-head { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 4px 0 6px; }
.c-nf .c-swatch { flex: none; width: 15px; height: 15px; border-radius: 4px; background: var(--swatch); }
.c-nf h3 { flex: 1; min-width: 0; margin: 0; font: 800 30px/1.2 var(--display); letter-spacing: -.022em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-nf-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; background: var(--canvas); box-shadow: 0 0 0 1px rgba(60, 40, 15, .2), 0 1px 0 rgba(255, 255, 255, .9); }
/* The film sits in the card like a screen set into it: a firm warm edge outside, and inside, over the film, a soft shadow
   along the top and a faint inner line, so the board in the film never runs into the white card. */
.c-nf-media::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; box-shadow: inset 0 2px 4px rgba(40, 20, 0, .14), inset 0 0 0 1px rgba(60, 40, 15, .08); pointer-events: none; }
.c-poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* A film fades in over its poster once it plays, and back to the poster quickly when its note steps aside. */
.c-nf .c-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .16s ease; }
.c-nf.is-live .c-video { opacity: 1; transition-duration: .2s; }
.c-nf-desc p { margin: 0; font-size: 21px; font-weight: 430; line-height: 1.5; color: var(--text); }
/* About 17px on screen across the card's width. Lines run to the card's edge (pretty, not balance: balancing evened
   the lines out and left a gap down the right); pretty only keeps a last word from sitting alone.
   22.5px under it is 18px on screen, the white space before the film. */
.c-nf-desc p > span { display: block; max-width: none; padding: 0 6px 22.5px; text-wrap: pretty; }
.c-board { -webkit-user-select: none; user-select: none; }
.c-play { position: absolute; inset: 0; z-index: 3; margin: 0; padding: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; }
.c-play:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

/* Without the script: two notes to a row. */
.c-board:not(.is-ready) .c-board-stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.c-board:not(.is-ready) .c-nf { width: auto; }
@media (max-width: 860px) { .c-board:not(.is-ready) .c-board-stage { grid-template-columns: minmax(0, 1fr); } }

/* Arranged: the stage holds the cards, each placed by a transform from its top-left corner; it is as tall as the
   two-by-two board, whichever arrangement is showing. */
.c-board.is-ready { position: relative; overflow-anchor: none; }
.is-ready .c-board-stage { position: relative; height: var(--stage); }
/* Moves match the app's own (its image open: 420 ms, quick out of the gate and settling in), not a slow ease-in-out. */
.is-ready .c-nf { --move: .42s cubic-bezier(.22, .61, .36, 1); position: absolute; left: 0; top: 0; transform-origin: 0 0; transition: transform var(--move), opacity .2s ease, box-shadow .24s ease; will-change: transform; }
/* In the air: lifted and carried, with a deeper shadow until it's set down again. */
.is-ready .c-nf.is-moving { transition: transform var(--move), opacity .2s ease, box-shadow .12s ease; }
.is-ready .c-nf.is-moving { --lift: 0 3px 5px rgba(40, 18, 0, .12), 0 27px 39px -8px rgba(40, 18, 0, .30), 0 71px 95px -22px rgba(40, 18, 0, .55); }
/* Two by two, the card playing is lifted off the board: a deeper, softer shadow (and a touch larger, from the script). */
.is-ready .c-nf.is-current { --lift: 0 2px 3px rgba(40, 18, 0, .18), 0 19px 27px -7px rgba(40, 18, 0, .30), 0 53px 73px -19px rgba(40, 18, 0, .61); }
/* The card opening, and any card in motion, stays above the others as they pass. Settled two by two, the playing card keeps
   its place in the stack, so its deeper shadow falls on the cork and goes under the row below, not across it. */
.is-ready .c-nf.is-moving { z-index: 1; }
.is-ready .c-nf.is-focus { z-index: 2; }
.is-ready .c-nf.is-focus { --lift: 0 2px 3px rgba(40, 18, 0, .18), 0 17px 26px -7px rgba(40, 18, 0, .28), 0 46px 66px -17px rgba(40, 18, 0, .57); }
/* Two by two every card shows its description; with one open, only the card in front does. */
.is-ready .c-nf-desc { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .32s cubic-bezier(.22, .61, .36, 1), opacity .12s ease; }
.is-ready .c-nf-desc > p { min-height: 0; overflow: hidden; }
.is-ready.is-grid .c-nf-desc, .is-ready .is-focus .c-nf-desc { grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .32s cubic-bezier(.22, .61, .36, 1), opacity .2s ease .16s; }
.is-measuring .c-nf, .is-instant .c-nf, .is-instant .c-nf-desc { transition: none !important; }
.is-ready .c-nf:not(.is-focus):not(.is-current):hover { --lift: 0 1px 2px rgba(40, 18, 0, .24), 0 12px 19px -5px rgba(40, 18, 0, .29), 0 37px 54px -15px rgba(40, 18, 0, .59); }

/* Stacked (narrow screens): the notes in order, full width, each settling in as it scrolls into view. */
.c-board.is-stacked .c-board-stage { height: auto; display: grid; gap: 18px; }
.c-board.is-stacked .c-nf { position: relative; width: auto; transform: none !important; opacity: 1; translate: 0 16px; transition: translate .42s cubic-bezier(.22, .61, .36, 1), opacity .3s ease; }
.c-board.is-stacked .c-nf.is-in { translate: none; }
.c-board.is-stacked .c-nf-desc { grid-template-rows: 1fr; opacity: 1; }
.c-board.is-stacked .c-nf h3 { white-space: normal; font-size: 22px; line-height: 1.15; text-wrap: balance; }
.c-board.is-stacked .c-nf-head { height: auto; padding: 14px 4px 8px 6px; align-items: flex-start; }
.c-board.is-stacked .c-nf-desc p { font-size: 16px; }
.c-board.is-stacked .c-nf-desc p > span { padding-bottom: 18px; }
.c-board.is-stacked .c-nf .c-swatch { width: 13px; height: 13px; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .is-ready .c-nf, .is-ready .c-nf-desc, .c-nf .c-video, .c-board.is-stacked .c-nf { transition: none !important; }
  .c-board.is-stacked .c-nf { translate: none; }
}
