/* The small things on the main page (js/scraps.js): the "Before us" chapter on its two strands of yarn, and the row of
   one-off prints under each season. Nothing here moves except a print straightening when it is pointed at. */

/* a small print, taped on */
.scrap { position: relative; width: min-content; margin: 0; padding: 6px 6px 7px; background: #fff; box-shadow: 0 1px 2px rgba(var(--shadow),.2), 0 8px 16px -8px rgba(var(--shadow),.55); transform: rotate(var(--tilt, 0deg)); transition: transform .25s; }
.scrap::before { content: ''; position: absolute; top: -9px; left: 50%; width: 46px; height: 17px; margin-left: -23px; background: rgba(238,143,150,.5); transform: rotate(-3deg); }
.scrap:nth-child(even)::before { background: rgba(126,163,216,.5); transform: rotate(4deg); }
.scrap:hover { transform: rotate(0) scale(1.05); z-index: 2; }
.scrap img { height: 136px; width: auto; max-width: none; background: #e9dcc6; cursor: zoom-in; }
.scrap figcaption { font-family: 'Caveat', cursive; font-size: 20px; line-height: 1.05; padding-top: 5px; }
.scrap small { display: block; font-family: 'Fraunces', serif; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); margin-top: 3px; }
/* one she texted him: shaped like a message, with its corner toward her */
.scrap.sent { padding: 0; background: none; box-shadow: none; }
.scrap.sent::before { display: none; }
.scrap.sent img { border: 4px solid #f9cfd3; border-radius: 22px 22px 22px 5px; box-shadow: 0 8px 16px -8px rgba(var(--shadow),.55); }

/* before us */
.before { position: relative; max-width: 1040px; margin: clamp(56px, 9vw, 110px) auto 0; padding: 0 18px; }
.before > header { position: relative; z-index: 1; text-align: center; margin-bottom: 44px; }
.before h2 { margin: 0; font-size: clamp(38px, 5.6vw, 68px); line-height: 1; }
.before h2 span { color: #7ea3d8; }
.before > header .hand { display: block; margin: 8px 0 0; }
.before > header a { color: var(--pink); font-weight: 700; text-decoration: none; } .before > header a:hover { text-decoration: underline; }
.yarn { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.beat { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr minmax(0, 50%) 1fr; align-items: center; gap: 0 26px; min-height: 96px; margin: 30px 0; }
.beat .prints, .unplaced .prints { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 2px; }
.beat .prints { grid-column: 2; grid-row: 1; }
.beat .say { grid-column: 1; grid-row: 1; text-align: right; }
.beat:nth-of-type(even) .say { grid-column: 3; text-align: left; }
.say small { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.say p { margin: 2px 0 0; font-family: 'Caveat', cursive; font-size: 25px; line-height: 1.12; }
.say a { font-family: 'Caveat', cursive; font-size: 21px; color: var(--pink); }
.tie { position: relative; z-index: 1; margin-top: 120px; text-align: center; }
.tie svg { display: block; margin: 0 auto; overflow: visible; }
.tie .hand { margin: 4px 0 0; font-size: 28px; color: var(--ink); }
.before + #seasons { margin-top: 0; }

/* a season's one-off photos: an album pocket across the page after its cards. A stitched sleeve with a label, the prints loose in it
   (no tape, smaller than a card), so they read as their own thing and not as events without a picture. */
.cards > .pocket { grid-column: 1 / -1; position: relative; justify-self: center; max-width: 100%; margin-top: 6px; padding: 26px 30px 20px; border-radius: 10px; background: rgba(255,251,242,.5);
  box-shadow: inset 0 0 0 2px rgba(255,253,248,.7), 0 10px 20px -16px rgba(var(--shadow),.6); outline: 2px dashed rgba(var(--shadow),.28); outline-offset: -8px; }
.pocket > b { position: absolute; left: 26px; top: -15px; padding: 2px 14px 4px; font: 700 21px/1.1 'Caveat', cursive; color: var(--soft); background: #fffdf8; border-radius: 3px; rotate: -2deg; box-shadow: 0 4px 8px -5px rgba(var(--shadow),.6); }
.pocket > div { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 16px 22px; }
.pocket .scrap { padding: 5px 5px 6px; } .pocket .scrap::before { display: none; }
.pocket .scrap img { height: 112px; } .pocket .scrap figcaption { font-size: 18px; min-width: 100%; width: 0; }
@media (max-width: 760px) { .cards > .pocket { padding: 24px 14px 14px; } .pocket .scrap img { height: 92px; } }

/* Before us, shorter (index.html?before=…, while Eric compares them; "tall" is the first version).
   rows: the entries run across the page in rows, each hanging from the strands with its words underneath; the strands snake from row to row. */
.before.rows { max-width: none; width: min(100vw - 40px, 1560px); margin-inline: calc(50% - min(50vw - 20px, 780px)); padding: 0; }   /* wider than the page's column, so more entries fit a row */
.before.rows .flow { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 58px 30px; padding: 30px 0 0; }
.before.rows .beat { display: block; min-height: 0; margin: 0; max-width: 100%; }
.before.rows .beat .prints { flex-wrap: nowrap; gap: 4px; justify-content: center; }
.before.rows .beat .say, .before.rows .beat:nth-of-type(even) .say { text-align: center; margin: 12px auto 0; max-width: 15em; }
.before.rows .beat:has(.scrap + .scrap + .scrap + .scrap) .prints { flex-wrap: wrap; max-width: 620px; }
.before.rows .beat.wordy { align-self: center; max-width: 13em; padding: 10px 14px; background: rgba(255,250,240,.75); border-radius: 12px; }
.before.rows .beat.wordy .say { margin-top: 0; }
.before.rows .scrap img { height: 150px; }
.before.rows .say p { font-size: 23px; }
.before.rows .tie { margin-top: 90px; }
@media (max-width: 760px) { .before.rows .scrap img { height: 120px; } .before.rows { max-width: none; width: min(100vw - 40px, 1560px); margin-inline: calc(50% - min(50vw - 20px, 780px)); padding: 0; }   /* wider than the page's column, so more entries fit a row */
.before.rows .flow { gap: 50px 18px; } }
/* piles: Before us by theme. Four heaps of taped prints, each on a soft wash of its own colour like the seasons' ground, with its
   name written over it and a few words on slips of paper among the prints. The prints overlap a little, as in a real heap. */
.before.piles { max-width: 1180px; }
.before.piles .piles { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 46px 30px; align-items: start; }
.pile { position: relative; isolation: isolate; padding: 26px 22px 34px; }
.pile.p1 { grid-column: span 4; --wash: 196,214,240; } .pile.p2 { grid-column: span 8; --wash: 249,214,178; } .pile.p3 { grid-column: span 5; --wash: 249,207,211; } .pile.p4 { grid-column: span 7; --wash: 216,206,238; }
.pile::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 46% 54% 48% 52% / 16% 14% 18% 15%; filter: url(#rough) blur(5px);
  background: radial-gradient(ellipse at 30% 20%, rgba(var(--wash),.8), rgba(var(--wash),.42) 55%, rgba(var(--wash),.12) 82%, transparent); }
.pile header { text-align: center; margin-bottom: 20px; }
.pile h3 { margin: 0; font-style: italic; font-weight: 400; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; }
.pile header .hand { margin: 4px auto 0; font-size: 23px; line-height: 1.1; max-width: 22em; }
.heap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 0; padding: 0 8px; }
.heap .scrap { margin: 0 -7px; } .heap .scrap:nth-child(3n) { margin-top: 14px; } .heap .scrap:nth-child(4n+1) { margin-top: -10px; }
.heap .scrap img { height: 132px; } .pile.small .scrap img { height: 96px; } .pile.small .heap { gap: 8px 0; } .pile.small .scrap { margin: 0 -10px; }
.heap .scrap figcaption { font-size: 18px; max-width: 150px; min-width: 100%; width: 0; }
.slip { position: relative; z-index: 1; width: 150px; margin: 0 4px; padding: 10px 12px 12px; font-family: 'Caveat', cursive; font-size: 20px; line-height: 1.08; text-align: center; background: #fffdf8; box-shadow: 0 6px 12px -8px rgba(var(--shadow),.6); transform: rotate(var(--tilt, 0deg)); }
.before.piles .tie { margin-top: 50px; }
@media (max-width: 900px) { .pile.p1, .pile.p2, .pile.p3, .pile.p4 { grid-column: 1 / -1; } .heap .scrap img { height: 110px; } .pile.small .scrap img { height: 84px; } }

/* roll: no yarn at all. The photos from before are a roll of film cut into strips: each entry is a piece of the strip, its frames
   side by side between the sprocket holes, with its date and words written underneath; an entry with no photo is a title card
   in the film. The pieces sit edge to edge, so a row reads as one strip. */
.before.roll .roll { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 34px 0; }
.before.roll .beat { display: flex; flex-direction: column-reverse; align-items: stretch; min-height: 0; margin: 0; gap: 8px; }
.before.roll .beat .prints, .before.roll .beat.wordy { --film: #2a2d4f; flex-wrap: nowrap; justify-content: flex-start; gap: 5px; padding: 17px 5px; background:
  repeating-linear-gradient(90deg, transparent 0 8px, #f7eddc 8px 17px, transparent 17px 25px) 0 4.500px / auto 8px repeat-x, repeating-linear-gradient(90deg, transparent 0 8px, #f7eddc 8px 17px, transparent 17px 25px) 0 calc(100% - 4.500px) / auto 8px repeat-x, var(--film);
  box-shadow: 0 10px 16px -12px rgba(var(--shadow),.8); }
.before.roll .beat .prints { min-width: 176px; box-sizing: border-box; justify-content: center; }   /* a single upright frame still leaves room for its words underneath */
.before.roll .beat:has(.scrap:nth-child(5)) .scrap img { height: 118px; } .before.roll .beat:has(.scrap:nth-child(7)) .scrap img { height: 104px; }   /* a long entry (Halloween's six) in smaller frames, so its piece fits the page */
.before.roll .beat.wordy { flex-direction: row; } .before.roll .beat.wordy .prints { display: none; }
.before.roll .scrap, .before.roll .scrap.sent { padding: 0; background: none; box-shadow: none; transform: none; } .before.roll .scrap::before { display: none; }
.before.roll .scrap img, .before.roll .scrap.sent img { display: block; height: 150px; border: 0; border-radius: 2px; box-shadow: none; }
.before.roll .scrap:hover { transform: none; } .before.roll .scrap figcaption { display: none; }
.before.roll .beat .say, .before.roll .beat:nth-of-type(even) .say { text-align: left; padding: 0 10px; max-width: none; width: 0; min-width: calc(100% - 20px); box-sizing: content-box; }
.before.roll .say small { font-size: 11px; } .before.roll .say p { font-size: 21px; line-height: 1.08; }
/* a title card: a frame of the film with only words in it */
.before.roll .beat.wordy .say { width: 190px; min-width: 0; height: 150px; box-sizing: border-box; padding: 10px 12px; display: grid; align-content: center; text-align: center; background: #fff6e6; border-radius: 2px; }
.before.roll .beat.wordy .say p { font-size: 19px; }
.before.roll .tie { margin-top: 44px; } .before.roll .tie svg { display: none; }
@media (max-width: 760px) { .before.roll .beat .prints { flex-wrap: wrap; min-width: 150px; } .before.roll .beat:has(.scrap:nth-child(5)) .scrap img { height: 84px; } .before.roll .scrap img { height: 104px; } .before.roll .beat.wordy .say { height: 104px; width: 150px; } .before.roll .beat.wordy .say p { font-size: 15px; } .before.roll .say p { font-size: 18px; } }
/* line: a washing line. The strands run across the top, the entries hang from them side by side, and the strip scrolls sideways. */
.before.line { max-width: none; padding: 0; }
.before.line .line { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 34px; overflow-x: auto; padding: 0 max(18px, calc(50vw - 520px)) 26px; scrollbar-width: thin; }
.before.line .yarn2 { position: absolute; left: 0; top: 0; pointer-events: none; }
.before.line .beat { flex: none; display: block; min-height: 0; margin: 46px 0 0; max-width: 420px; }
.before.line .beat .prints { flex-wrap: nowrap; justify-content: flex-start; gap: 4px; }
.before.line .beat .say, .before.line .beat:nth-of-type(even) .say { text-align: left; margin-top: 14px; max-width: 18em; }
.before.line .beat.wordy { align-self: center; max-width: 200px; }
.before.line .scrap img { height: 190px; }
.before.line .tie { margin-top: 26px; }

/* ?check: file names, open questions, what is not placed */
.scrap code { display: block; max-width: 100%; overflow-wrap: anywhere; font-size: 10px; line-height: 1.2; color: #7a5a10; padding-top: 3px; }
.before mark { display: block; margin-top: 6px; padding: 2px 8px; font-family: 'Fraunces', serif; font-size: 13px; line-height: 1.3; background: #fbe9a6; color: #5a4208; }
.unplaced { position: relative; z-index: 1; margin-top: 60px; padding: 14px; border: 2px dashed rgba(var(--shadow),.3); background: rgba(255,250,240,.85); } .unplaced .prints { margin-top: 18px; }

@media (max-width: 760px) {
  .beat { grid-template-columns: 1fr; gap: 12px; margin: 40px 0; }
  .beat .say, .beat:nth-of-type(even) .say { grid-column: 1; grid-row: 1; text-align: center; max-width: 21em; margin-inline: auto; padding: 4px 10px; background: rgba(247,237,220,.82); border-radius: 12px; }
  .beat .prints { grid-column: 1; grid-row: 2; }
  .scrap img { height: 118px; } .also .scrap img { height: 104px; }
  .also > .hand { width: 100%; margin: 0; text-align: center; transform: none; }
}

/* The section's class is `picture`, not `plate`: `.plate` is the cover's picture (css/decor.css) and would lay its soft paper edge and
   rounded corners over this whole section, which showed as a pale card floating on the page.
   plate (index.html?before=plate): the Before us painting set into the page with soft edges, like the cover's plate, so it does not read
   as one more season banner; under it the four themes as cards the shape of event cards, strung on the two strands, each under its part
   of the picture. A card opens its photos the way an event opens. */
.before.picture { max-width: 1180px; }
.before.picture > header { margin-bottom: 20px; }
.bplate { position: relative; z-index: 1; overflow: hidden; border-radius: 10px;   /* soft edges by a mask, like the cover's picture (css/decor.css) */
  -webkit-mask-image: linear-gradient(transparent, #000 36px, #000 calc(100% - 36px), transparent), linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(transparent, #000 36px, #000 calc(100% - 36px), transparent), linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-composite: intersect; }
.bplate img { display: block; width: 100%; height: auto; background: #f1dcc4; }
.chapters { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; margin-top: 14px; padding: 0 2%; }
.chapters > svg { position: absolute; z-index: -1; left: -2%; top: -30px; width: 104%; height: calc(100% + 64px); overflow: visible; pointer-events: none; }
.chapters .polaroid { cursor: pointer; } .chapters .polaroid:nth-of-type(odd) { transform: rotate(-1.6deg); } .chapters .polaroid:nth-of-type(even) { transform: rotate(1.3deg) translateY(12px); }
.chapters .polaroid:hover { transform: rotate(0) scale(1.03); }
.chapters .polaroid img { aspect-ratio: 2 / 1; object-fit: cover; }
.chapters .polaroid::before { background: rgba(126,163,216,.6); } .chapters .polaroid:nth-of-type(odd)::before { background: rgba(238,143,150,.55); }
.before.picture .tie { margin-top: 40px; }
@media (max-width: 900px) { .chapters { grid-template-columns: 1fr 1fr; gap: 26px 18px; } }
/* a chapter, opened in the event page */
.chapter-shots { margin-top: 26px; } .chapter-shots.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.chapter-shots .slip { width: auto; margin: 0; align-self: center; }
.shot.sent { padding: 0; background: none; box-shadow: none; } .shot.sent img { border: 4px solid #f9cfd3; border-radius: 22px 22px 22px 5px; box-shadow: 0 8px 16px -8px rgba(var(--shadow),.55); }

/* the plate's other face: the same two years on a map of campus (a paper sheet with numbered pins) beside the list the numbers refer to.
   Two small words over the plate switch between the faces; the four cards stay under either. */
.bswitch { position: relative; z-index: 1; display: flex; justify-content: center; gap: 6px; margin: 0 0 12px; }
.bswitch button { padding: 2px 12px 5px; border: 0; border-bottom: 2px dashed transparent; background: none; font: 700 22px/1 'Caveat', cursive; color: var(--soft); cursor: pointer; }
.bswitch button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--pink); }
.bfaces[data-face="time"] > .campus, .bfaces[data-face="place"] > .bplate { display: none; }
.bfaces > * { animation: face .5s ease both; } @keyframes face { from { opacity: 0; } }
.before .campus { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 34px; align-items: center; }
.csheet { padding: 10px; background: var(--card); box-shadow: 0 1px 2px rgba(var(--shadow),.18), 0 16px 30px -14px rgba(var(--shadow),.4); rotate: -.6deg; }
.csheet > div { position: relative; }
.csheet img { display: block; width: 100%; height: auto; aspect-ratio: 1500 / 900; background: #f6d9b6; }
.cpin { position: absolute; translate: -50% -50%; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 700 19px/1 'Caveat', cursive; color: var(--ink); background: var(--card); box-shadow: 0 0 0 3px var(--ink), 0 4px 8px -2px rgba(var(--shadow),.6); }
.cpin.end { width: 36px; height: 36px; font-size: 23px; color: #fff; background: var(--pink); box-shadow: 0 0 0 3px #fff, 0 4px 8px -2px rgba(var(--shadow),.6); }
.cpin span { position: absolute; left: 50%; top: 100%; translate: -50% 3px; white-space: nowrap; font-size: 18px; color: var(--ink); text-shadow: 0 0 5px var(--card), 0 0 3px var(--card), 0 0 2px var(--card); }
.cname { position: absolute; translate: -50% -50%; white-space: nowrap; font: 500 16px/1 'Caveat', cursive; color: var(--soft); }
.ctrail { list-style: none; margin: 0; padding: 0; }
.ctrail li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 2px 0; border-bottom: 1px dashed rgba(var(--shadow), .2); }
.ctrail li > b { font: 700 22px/1 'Caveat', cursive; color: var(--pink); text-align: center; }
.ctrail small { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.ctrail p { margin: 0; font-family: 'Caveat', cursive; font-size: 20px; line-height: 1.05; }
.ctrail .thumb { padding: 0; background: none; box-shadow: none; transform: rotate(3deg); } .ctrail .thumb::before { display: none; }
.ctrail .thumb img { display: block; width: 38px; height: 38px; object-fit: cover; border: 3px solid #fff; box-shadow: 0 4px 8px -4px rgba(var(--shadow), .6); }
@media (max-width: 900px) { .before .campus { grid-template-columns: 1fr; gap: 18px; } .cpin { width: 22px; height: 22px; font-size: 15px; } .cpin span, .cname { font-size: 13px; } }
