/* §03B / §11 sad section layouts (owned by .source/sad.mjs).
   One composition per slide (data-layout). Black, sparse, letterboxed. Loads after the section files,
   so these override the old shared flow in sec-maxx.css (.sad .sad-h / .sad-s / .sad-tag / .mx-k). */

/* ---------- shared: every generated sad slide places its own pieces ---------- */
.reveal section.sad[data-layout] .sad-s { margin-top: 0 !important; }
.reveal section.sad[data-layout] .sad-tag { margin-top: 0; }
.reveal section.sad[data-layout] .sad-cite { margin-top: 0 !important; }
.sad[data-layout] .sad-h { margin: 0; }
.sad[data-layout] i.L { display: block; }

/* blinking input caret (frozen in ?capture and for reduced motion) */
@keyframes sad-blink { 0%, 52% { opacity: 1; } 58%, 94% { opacity: .14; } 100% { opacity: 1; } }
.sad-blink { display: block; width: 100%; height: 100%; background: var(--fg); animation: sad-blink 1.1s steps(1) infinite; }
html.sad-still .sad-blink { animation: none; }
@media (prefers-reduced-motion: reduce) { .sad-blink { animation: none; } }

/* ---------- frames: you, two people, four, eight. empty portraits fading back into the dark ---------- */
.sad-tree { left: 0; top: 0; width: 1920px; height: 1080px; pointer-events: none; }
.sad-tree svg { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
.sad-tree path { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.sad-tree .k1 { stroke-opacity: .55; } .sad-tree .k2 { stroke-opacity: .32; } .sad-tree .k3 { stroke-opacity: .17; }
.sad-gen { position: absolute; inset: 0; }
.sad-gen i { position: absolute; box-sizing: border-box; border: 2px solid var(--fg); background: rgba(255,255,255,.025); }
.sad-gen.g1 { opacity: .62; } .sad-gen.g2 { opacity: .36; } .sad-gen.g3 { opacity: .18; }
.sad[data-layout="frames"] .sad-h { left: 96px; top: 500px; width: 900px; font-size: 150px; line-height: .86; white-space: nowrap; overflow: hidden; }
.sad[data-layout="frames"] .sad-s { left: 96px; top: 790px; width: 860px; font-size: 40px; line-height: 1.38; }

/* ---------- twins: the headline twice, side by side ---------- */
.sad-twin { top: 196px; width: 840px; height: 500px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.sad-twin.a { left: 96px; } .sad-twin.b { left: 984px; }
.sad[data-layout="twins"] .sad-h { width: min-content; font-size: 250px; line-height: .86; text-align: center; text-wrap: wrap; }
.sad[data-layout="twins"] .sad-vr { left: 959px; top: 226px; width: 2px; height: 440px; background: var(--line2); }
.sad[data-layout="twins"] .sad-tag { left: 96px; right: 96px; width: max-content; margin: 0 auto; top: 740px; }
.sad[data-layout="twins"] .sad-s { left: 360px; width: 1200px; top: 806px; text-align: center; text-wrap: balance; font-size: 42px; line-height: 1.38; }

/* ---------- column: the headline stacked tall against a measuring rule ---------- */
.sad[data-layout="column"] .sad-ruler { left: 150px; top: 212px; width: 40px; height: 800px;
  background:
    linear-gradient(var(--fg2), var(--fg2)) 0 0 / 2px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--fg2) 0 2px, transparent 2px 120px) 0 0 / 34px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--line2) 0 2px, transparent 2px 24px) 0 0 / 14px 100% no-repeat; }
.sad[data-layout="column"] .sad-mark { left: 150px; top: 206px; width: 500px; height: 2px; background: var(--fg); }
.sad[data-layout="column"] .sad-h { left: 236px; top: 222px; width: min-content; font-size: 172px; line-height: .84; text-wrap: wrap; }
.sad[data-layout="column"] .sad-s { left: 1000px; top: 770px; width: 820px; font-size: 42px; line-height: 1.38; }

/* ---------- landmarks: the dots and lines the forums draw on faces, with no face ---------- */
.sad-lm, .sad-lm-pt { left: 0; top: 0; width: 1920px; height: 1080px; pointer-events: none; }
.sad-lm path, .sad-lm circle { fill: none; stroke: var(--fg2); stroke-width: 1.6; }
.sad-lm .ld { stroke: var(--muted); stroke-width: 1.2; }
.sad-lm-pt circle { fill: var(--fg); }
.sad-lbl { font: 400 19px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--fg2); white-space: nowrap; }
.sad[data-layout="landmarks"] .sad-h { left: 96px; top: 180px; width: 900px; font-size: 150px; line-height: .86; white-space: nowrap; overflow: hidden; }
.sad[data-layout="landmarks"] .sad-tag { left: 96px; top: 470px; }
.sad[data-layout="landmarks"] .sad-s { left: 96px; top: 690px; width: 780px; font-size: 40px; line-height: 1.38; }

/* ---------- dicepair: the first roll landed; the second hasn't ---------- */
.sad-die { box-sizing: border-box; width: 250px; height: 250px; border-radius: 38px; }
.sad-die.one { left: 640px; top: 196px; display: grid; place-items: center; background: #f2f2f2; box-shadow: inset 0 0 0 3px #000, inset 0 0 44px rgba(0,0,0,.24); transform: rotate(-6deg); }
.sad-die.one b { width: 54px; height: 54px; border-radius: 50%; background: #000; }
.sad-die.two { left: 1030px; top: 186px; border: 3px dashed var(--fg2); transform: rotate(18deg); }
.sad-cap { top: 488px; width: 250px; text-align: center; font: 400 19px/1 var(--f-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.sad-cap.one { left: 640px; } .sad-cap.two { left: 1030px; }
.sad[data-layout="dicepair"] .sad-h { left: 96px; width: 1728px; top: 588px; text-align: center; font-size: 140px; line-height: .86; white-space: nowrap; }
.sad[data-layout="dicepair"] .sad-s { left: 360px; width: 1200px; top: 762px; text-align: center; text-wrap: balance; font-size: 42px; line-height: 1.38; }

/* ---------- void: small type alone in the black ---------- */
.sad-void { left: 360px; width: 1200px; top: 470px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.sad[data-layout="void"] .sad-h { font-size: 60px; line-height: 1; letter-spacing: .05em; white-space: nowrap; }
.reveal section.sad[data-layout="void"] .sad-s { margin-top: 30px !important; width: 640px; text-wrap: balance; font-size: 26px; line-height: 1.5; color: var(--muted); }
.sad-void .sad-tag { margin-bottom: 30px !important; }

/* ---------- quote: the sentence is the big line, the headline is the caption ---------- */
.sad[data-layout="quote"] .sad-h { left: 96px; top: 236px; font-size: 74px; line-height: 1; letter-spacing: .03em; white-space: nowrap; }
.sad[data-layout="quote"] .sad-rule { left: 96px; top: 340px; width: 140px; height: 4px; background: var(--fg); }
.sad[data-layout="quote"] .sad-s { left: 96px; top: 392px; width: 1560px; font-size: 96px; line-height: 1.16; color: var(--fg); }

/* ---------- subtitle: a film still. wide bars, the line at the bottom of the picture ---------- */
.reveal section.sad[data-layout="subtitle"] > .lbox i { height: 132px; }
.reveal section.sad[data-layout="subtitle"] > .folio { z-index: 46 !important; }
.reveal section.sad[data-layout="subtitle"] .mx-k { top: 1004px; z-index: 46 !important; }
.sad-sub { left: 160px; width: 1600px; bottom: 172px; text-align: center; }
.sad[data-layout="subtitle"] .sad-h { font: 600 60px/1.2 var(--f-body); text-transform: none; letter-spacing: 0; white-space: nowrap; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.reveal section.sad[data-layout="subtitle"] .sad-s { margin: 8px auto 0 !important; width: 1240px; text-wrap: balance; font: italic 400 46px/1.25 var(--f-body); color: #d4d4d4; text-shadow: 0 2px 10px rgba(0,0,0,.8); }

/* ---------- midline: dead centre, on the line ---------- */
.sad[data-layout="midline"] .sad-mid { left: 0; top: 559px; width: 1920px; height: 2px; background: var(--line2); }
.sad[data-layout="midline"] .sad-tick { left: 959px; top: 546px; width: 2px; height: 28px; background: var(--fg); }
.sad[data-layout="midline"] .sad-h { left: 96px; width: 1728px; top: 410px; text-align: center; font-size: 150px; line-height: .86; white-space: nowrap; }
.sad[data-layout="midline"] .sad-s { left: 410px; width: 1100px; top: 606px; text-align: center; text-wrap: balance; font-size: 38px; line-height: 1.4; }

/* ---------- crop: one huge word, cut off by the bottom of the frame ---------- */
.sad[data-layout="crop"] .sad-h { left: 50px; right: 6px; bottom: 34px; height: .728em; overflow: hidden; line-height: .866; white-space: nowrap; }
.sad[data-layout="crop"] .sad-tag { left: 96px; top: 206px; }
.sad[data-layout="crop"] .sad-s { left: 96px; top: 262px; width: 1000px; font-size: 42px; line-height: 1.38; }

/* ---------- typewriter: typed onto the page, one key at a time ---------- */
.sad[data-layout="typewriter"] .sad-form { left: 96px; top: 566px; width: 1728px; height: 2px; background: var(--line2); }
.sad[data-layout="typewriter"] .sad-tw { left: 96px; top: 430px; font: 400 100px/1.1 var(--f-type); text-transform: none; white-space: nowrap; color: var(--fg); }
.sad[data-layout="typewriter"] .sad-s { left: 96px; top: 612px; width: 1300px; font: 400 44px/1.45 var(--f-type); color: var(--fg2); }

/* ---------- card: an index card on the table, the year stamped on it ---------- */
.sad-card { left: 300px; top: 168px; width: 1320px; height: 744px; transform: rotate(-1.2deg); z-index: 2 !important;
  --fg: #000; --fg2: #222; --muted: #666; --bg: #f2f2f2; --acc: #000; --on-acc: #fff; --line: rgba(0,0,0,.16); --line2: rgba(0,0,0,.45);
  color: var(--fg); background: #f2f2f2; box-shadow: 0 40px 90px rgba(0,0,0,.7); }
.sad-card::before { content: ''; position: absolute; inset: 0; background-image: var(--toner); background-size: 360px 360px; opacity: .3; pointer-events: none; }
.sad-card > * { position: absolute !important; z-index: 1; }
.sad-card .sad-tag { left: 64px; top: 62px; }
.sad-card .sad-stamp { right: 76px; top: 44px; width: 344px; height: 204px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 7px solid #000; box-shadow: inset 0 0 0 6px #f2f2f2, inset 0 0 0 8px #000; transform: rotate(-7deg);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='200'><filter id='r'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/><feComponentTransfer><feFuncA type='discrete' tableValues='1 1 1 1 1 0 1 1 1 1 0 1 1 1'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23r)'/></svg>");
  -webkit-mask-size: 420px 210px;
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='200'><filter id='r'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/><feComponentTransfer><feFuncA type='discrete' tableValues='1 1 1 1 1 0 1 1 1 1 0 1 1 1'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23r)'/></svg>");
  mask-size: 420px 210px; }
.sad-card .sad-stamp .sad-h { font-size: 190px; line-height: .86; color: #000; }
.sad-card .sad-card-rule { left: 64px; right: 64px; top: 300px; height: 2px; background: #000; display: block; }
.sad-card .sad-s { left: 64px; top: 340px; width: 1100px; font: 400 42px/1.45 var(--f-type); color: #111; }
.sad-card .sad-cite { left: 64px; bottom: 56px; font-size: 20px; color: #555; }

/* ---------- ladder: the forums' tiers, top to bottom. names only ---------- */
.sad-stair { left: 0; top: 0; width: 1920px; height: 1080px; pointer-events: none; }
.sad-stair path { fill: none; stroke: var(--fg); stroke-width: 2; }
.sad-tier { font: 400 40px/1 var(--f-head); letter-spacing: .04em; text-transform: uppercase; color: var(--fg); white-space: nowrap; }
.sad[data-layout="ladder"] .sad-h { left: 96px; top: 196px; width: 680px; font-size: 190px; line-height: .86; white-space: nowrap; overflow: hidden; }
.sad[data-layout="ladder"] .sad-tag { left: 96px; top: 390px; }
.sad[data-layout="ladder"] .sad-s { left: 96px; top: 690px; width: 660px; font-size: 38px; line-height: 1.38; }

/* ---------- score: an empty score, waiting for a number ---------- */
.sad[data-layout="score"] .sad-h { left: 96px; top: 196px; font-size: 210px; line-height: .86; white-space: nowrap; }
.sad[data-layout="score"] .sad-tag { left: 96px; top: 400px; }
.sad[data-layout="score"] .sad-s { left: 96px; top: 600px; width: 600px; font-size: 40px; line-height: 1.38; }
.sad-score { left: 800px; top: 470px; width: 1000px; height: 400px; }
.sad-score > * { position: absolute; display: block; }
.sad-slot { left: 0; top: 340px; width: 300px; height: 12px; }
.sad-of { left: 330px; top: 0; font: 400 400px/.86 var(--f-display); color: var(--fg); }

/* ---------- entry: written up like a dictionary entry. plain and grim ---------- */
.sad[data-layout="entry"] .sad-h { left: 96px; top: 196px; font-size: 190px; line-height: .86; white-space: nowrap; }
.sad[data-layout="entry"] .sad-bar { left: 96px; top: 396px; width: 1728px; height: 8px; background: var(--fg); }
.sad[data-layout="entry"] .sad-tag { left: 96px; top: 458px; }
.sad[data-layout="entry"] .sad-s { left: 560px; top: 446px; width: 1100px; font: 400 46px/1.46 var(--f-serif); color: var(--fg); }

/* ---------- fallen: the letters lie down on the floor ---------- */
.sad[data-layout="fallen"] .sad-tag { left: 96px; top: 206px; }
.sad[data-layout="fallen"] .sad-s { left: 96px; top: 264px; width: 1150px; font-size: 50px; line-height: 1.36; }
.sad[data-layout="fallen"] .sad-floor { left: 96px; top: 900px; width: 1728px; height: 2px; background: var(--line2); }
.sad[data-layout="fallen"] .sad-fall { left: 290px; bottom: 180px; font-size: 320px; line-height: .682; white-space: nowrap; }
.sad-fall span { display: inline-block; width: .42em; margin-right: .394em; text-align: right; transform-origin: 100% 100%; transform: rotate(90deg); }

/* ---------- mirror: the word, and the word in the glass ---------- */
.sad[data-layout="mirror"] .sad-h { left: 96px; top: 330px; width: 880px; font-size: 230px; line-height: .86; white-space: nowrap; overflow: hidden; }
.sad[data-layout="mirror"] .sad-s { left: 96px; top: 600px; width: 820px; font-size: 44px; line-height: 1.38; }
.sad-glass { left: 1030px; top: 136px; width: 790px; height: 808px; box-sizing: border-box; border: 2px solid var(--fg2); overflow: hidden;
  background: linear-gradient(118deg, rgba(255,255,255,.07), rgba(255,255,255,0) 34%, rgba(255,255,255,.035) 58%, rgba(255,255,255,0) 72%); }
.sad-flip { position: absolute; inset: 0; transform: scaleX(-1); opacity: .5; }
.sad[data-layout="mirror"] .sad-glass .sad-copy { position: absolute; left: 0; right: 0; top: 192px; text-align: center; font-size: 230px; line-height: .86; white-space: nowrap; }
.sad-angle { position: absolute; left: 0; top: 0; width: 786px; height: 804px; }
.sad-angle path { fill: none; stroke: var(--fg2); stroke-width: 1.5; }

/* ---------- feed: the same post, over and over ---------- */
.sad[data-layout="feed"] .sad-h { left: 96px; top: 210px; width: 880px; font-size: 180px; line-height: .86; white-space: nowrap; overflow: hidden; }
.sad[data-layout="feed"] .sad-s { left: 96px; top: 600px; width: 760px; font-size: 42px; line-height: 1.38; }
.sad-feed { left: 1040px; top: 34px; width: 784px; height: 1012px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent); }
.sad-feed-in { position: absolute; left: 0; right: 0; top: 0; }
.sad-post { display: flex; align-items: center; gap: 26px; height: 84px; border-bottom: 1px solid var(--line); font: 400 26px/1 var(--f-mono); letter-spacing: .02em; color: var(--muted); }
.sad-post i { width: 34px; height: 34px; flex: none; box-sizing: border-box; border: 2px solid var(--line2); }

/* ---------- stare: a slit of picture, two dice in it ---------- */
.reveal section.sad[data-layout="stare"] > .lbox i { height: 250px; }
.reveal section.sad[data-layout="stare"] > .folio { z-index: 46 !important; }
.reveal section.sad[data-layout="stare"] .mx-k { top: 190px; z-index: 46 !important; }
.sad-stare { left: 700px; top: 250px; width: 520px; height: 220px; display: flex; justify-content: center; align-items: center; gap: 70px; perspective: 1400px; transform: scale(.36); }
.sad-stare .die:nth-child(1) { transform: rotateX(-14deg) rotateY(20deg); }
.sad-stare .die:nth-child(2) { transform: rotateX(-10deg) rotateY(-24deg); }
.sad[data-layout="stare"] .sad-h { left: 96px; width: 1728px; top: 520px; text-align: center; font-size: 110px; line-height: .86; white-space: nowrap; }
.sad[data-layout="stare"] .sad-s { left: 410px; width: 1100px; top: 650px; text-align: center; text-wrap: balance; font-size: 32px; line-height: 1.45; }

/* ---------- post: the after, never posted ---------- */
.sad[data-layout="post"] .sad-h { left: 96px; top: 300px; width: 940px; font-size: 170px; line-height: .86; white-space: nowrap; overflow: hidden; }
.sad-slotbox { left: 1180px; top: 176px; width: 520px; height: 650px; box-sizing: border-box; border: 2px dashed var(--fg2); }
.sad-slot-l { position: absolute; left: 22px; top: 22px; font: 400 19px/1 var(--f-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.sad-postbtn { left: 1180px; top: 858px; padding: 12px 22px 10px; border: 2px solid var(--line); font: 400 18px/1 var(--f-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
