/* Rune Nissen – 3D (/3d, 3d/index.html): Shortform's page (css/shortform.css, which this builds on) with clips lying
   down (16:9) instead of standing up – board "3D" in the canvas. At the top the name is huge, with Andreas & Rune
   standing behind its D. Each project: the client big on top, the case in a
   column to the left, then the clips: the first wide over both columns, two under it, and a line under each. Under
   1000px the case goes over the clips; on phones the clips are swiped one at a time with the next peeking in. A clip
   is Shortform's card lying down; a place still without one is drawn: a cube in line on a floor in perspective, as
   in a 3D program's viewport. */
/* ---------- The name huge, and Andreas & Rune behind its D (board "D Op ad titlen") ----------
   Everything here is in the title's em, so it all scales together: the D's right edge stands .0413em in from the
   word's box (its advance and letter-spacing), the letters' line .1em over its bottom. The film's box (690×876,
   tools/build-andreas-rune.py) stands with its left edge – where Andreas's arm leaves the picture – .03 of its width
   behind the D, and their soles on the line (.9 % over the box's bottom). The arm leaves at up to .75 of the box's
   height, which at .635em wide is .6em: under the D's cap height (.62em), so the D always covers it */
.td-big { position: relative; display: inline-block; font-size: clamp(264px, 36vw, 520px); }
.td .td-big h1 { position: relative; z-index: 2; font-size: 1em; line-height: .8; }
.td-duo { --w: .635em; position: absolute; left: calc(100% - .0413em - var(--w) * .03); bottom: .1em; z-index: 1; width: var(--w); aspect-ratio: 690 / 876; margin-bottom: calc(var(--w) * -.0115); pointer-events: none; }
.td-duo img, .td-duo video { position: absolute; inset: 0; width: 100%; height: 100%; }
.td-duo video { opacity: 0; }
.td-duo.is-playing .td-start { opacity: 1; }
.td-duo.is-playing img { opacity: 0; transition: opacity 0s .12s; }
/* Once their hand sign is done, the loop (its first frame the start's next) takes over: they stand looking round */
.td-duo.is-looping .td-loop { opacity: 1; }
.td-duo.is-looping .td-start { opacity: 0; transition: opacity 0s .1s; }
.td-duo::after { content: ''; position: absolute; left: 4%; right: 2%; bottom: -.6%; z-index: -1; height: 3.2%; border-radius: 50%; background: radial-gradient(closest-side, rgba(13,26,28,.26), rgba(13,26,28,.1) 55%, rgba(13,26,28,0)); }
/* They come out from behind the D once the name has risen; then the film starts (js/3d.js) */
.sf-anim [data-reveal] .td-duo { opacity: 0; transform: translateX(-26px); transition: opacity .45s ease .75s, transform .6s cubic-bezier(.2,.8,.2,1) .75s; }
.sf-anim [data-reveal].is-in .td-duo { opacity: 1; transform: none; }

/* ---------- A project: the case's column, then the clips ---------- */
.td-body { --case: clamp(220px, 17.8vw, 256px); display: grid; grid-template-columns: var(--case) minmax(0, 1fr); gap: clamp(32px, 3.9vw, 56px); align-items: start; margin-top: 56px; }
.td .td-body > .sf-case { grid-column: 1; max-width: none; margin: 0; }
.td-clips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3vw, 44px) clamp(16px, 2.2vw, 32px); }
.td-clips > .td-wide { grid-column: 1 / -1; }
.td-wide .sf-line { max-width: 620px; }

/* ---------- A clip lying down: the card's parts sized for 16:9 ---------- */
.td .sf-card { aspect-ratio: 16 / 9; }
.td .sf-card::before { --l: 4cqw; inset: 3cqw; transform: scale(1.04); }
.td .sf-tag { top: 4cqw; left: 4cqw; font-size: clamp(9px, 2.2cqw, 12px); }
.td .sf-info { gap: .45em; height: 50%; padding: 0 4.5cqw 4cqw; background: linear-gradient(180deg, rgba(5,10,11,0), rgba(5,10,11,.8)); }
.td .sf-info b { font-size: clamp(18px, 6.2cqw, 44px); }
.td .sf-info small { font-size: clamp(11px, 2.6cqw, 15px); }

/* A place still to fill: the floor's lines run to a point on the horizon and fade out towards it; the cube stands
   over it with its shadow */
.td .sf-card.is-empty { background: linear-gradient(180deg, #EDE8DC, #E3DCCE); }
.sf-card.is-empty .td-floor { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(13,26,28,.13); stroke-width: 1; -webkit-mask-image: linear-gradient(180deg, transparent 46%, #000 100%); mask-image: linear-gradient(180deg, transparent 46%, #000 100%); }
.td-floor path { vector-effect: non-scaling-stroke; }
.sf-card.is-empty .td-cube { position: absolute; left: 50%; top: 47%; width: clamp(40px, 9cqw, 96px); fill: none; stroke: rgba(13,26,28,.36); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; transform: translate(-50%, -50%); }
.td-cube ellipse { fill: rgba(13,26,28,.07); stroke: none; }

/* ---------- Dit projekt? (02): the places still without a film stand for the visitor's own project, and the case
   ends in a call instead of the lime line (the link is lime underneath, like Hjemmeside's "Besøg") ---------- */
.td-you .sf-case::after { display: none; }
.td-call { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding-bottom: 4px; border-bottom: 2px solid var(--lime); color: var(--petrol-900); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-decoration: none; text-transform: uppercase; }
.td-call i { font-style: normal; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.td-call:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 2px; }
@media (hover: hover) { .td-call:hover i { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .td-call i { transition: none; } }

/* ---------- Coming in: the case and the clips follow one by one, as on Shortform (the lines under the clips come in
   by css/shortform.css) ---------- */
.sf-anim [data-reveal] :is(.td-body > .sf-case, .td-clips > li) { opacity: 0; transform: translateY(56px) scale(.97); transition: opacity .5s ease calc(.3s + var(--i, 0) * 90ms), transform .75s cubic-bezier(.2,.8,.2,1) calc(.3s + var(--i, 0) * 90ms); }
.sf-anim [data-reveal].is-in :is(.td-body > .sf-case, .td-clips > li) { opacity: 1; transform: none; }

/* Too narrow for the column: the case goes over the clips */
@media (max-width: 1000px) {
  .td-body { display: block; }
  .td .td-body > .sf-case { max-width: 640px; margin-bottom: 36px; }
}
/* The phone: the case over the row, and the clips swiped one at a time, the next peeking in */
@media (max-width: 600px) {
  .td-big { font-size: min(67.5vw, 264px); }
  /* A long client (Sønderthon) keeps the 20px edge on the narrowest phones */
  .td .sf-head h2 { font-size: min(72px, 21vw); }
  .td-body { margin-top: 24px; }
  .td .td-body > .sf-case { margin-bottom: 0; }
  .td .sf-case::after { margin-top: 18px; }
  .td-clips { display: flex; gap: 14px; margin: 28px -20px 0; padding: 0 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none; }
  .td-clips::-webkit-scrollbar { display: none; }
  .td-clips > li { flex: 0 0 84vw; scroll-snap-align: start; }
  .td-wide .sf-line { max-width: none; }
}
