/* Section 4, results ("Desk", Flip over). Dark section on the brand grid; four receipts that
   spread with scroll; the case receipt turns over as it comes to the middle of the screen.
   Kept light: transforms only on the desk, one shadow per receipt, the open card is contained. */
@font-face { font-family: "IBM Plex Mono"; src: url(brandfonts/IBMPlexMono-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
.res { --px: clamp(24px, 7vw, 120px); --bg: #17110E; --ink: #F1E9DE; --muted: #B3A392; --grid: rgba(205,168,95,.085);
  position: relative; isolation: isolate; background: var(--bg); color: var(--ink); padding: clamp(110px, calc(var(--vh, 1vh) * 16), 180px) var(--px) clamp(110px, calc(var(--vh, 1vh) * 16), 170px); }
.res::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 64px 64px; background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%); }
.res-head { max-width: 1400px; margin: 0 auto clamp(40px, calc(var(--vh, 1vh) * 7), 76px); }
.res-head h2 { margin: 0 0 18px; font: 700 clamp(2.2rem, 4.8vw, 4.6rem)/1.02 var(--serif); letter-spacing: -0.03em; white-space: nowrap; }   /* one line (11 Oct) */
@media (max-width: 700px) { .res-head h2 { white-space: normal; } }
.res-head p { margin: 0; color: var(--muted); max-width: 26em; font-size: 1.0625rem; }
.res-foot { max-width: 1400px; margin: clamp(36px, calc(var(--vh, 1vh) * 6), 64px) auto 0; display: flex; justify-content: flex-end; align-items: center; gap: 16px 32px; flex-wrap: wrap; }
.res-foot p { margin: 0; color: var(--muted); font-size: .875rem; }
.bc { display: block; width: 100%; fill: currentColor; }

/* ---------- the desk ---------- */
.dsk { display: flex; justify-content: center; align-items: flex-start; padding: 30px 0 50px; max-width: 1400px; margin: 0 auto; }
.dsk-slip { all: unset; box-sizing: border-box; position: relative; flex: none; width: clamp(228px, 21vw, 292px); margin-left: -8px; padding: 30px 22px 22px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px; color: #17110E; background: #FAFAF8; box-shadow: 0 22px 50px rgba(0,0,0,.4);
  /* --s: 0 piled, 1 spread. Piled = moved to the centre with a small tilt; spread = fanned */
  transform: translateX(calc((1 - var(--s)) * var(--px))) translateY(calc(var(--s) * var(--ty))) rotate(calc(var(--pr) * (1 - var(--s)) + var(--r) * var(--s)));
  transition: transform .4s var(--ease), opacity .4s var(--ease); }
.dsk-slip:first-child { margin-left: 0; }
.dsk-slip::before, .dsk-slip::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; background-size: 18px 10px; background-repeat: repeat-x; }
.dsk-slip::before { top: -1px; background-image: radial-gradient(circle at 50% 0, var(--bg) 5px, transparent 5.6px); }
.dsk-slip::after { bottom: -1px; background-image: radial-gradient(circle at 50% 100%, var(--bg) 5px, transparent 5.6px); }
.dsk-slip:nth-child(1) { z-index: 1; --px: calc(1.5 * (100% - 8px)); --pr: -4deg; --r: -7deg; --ty: 26px; }
.dsk-slip:nth-child(2) { z-index: 2; --px: calc(.5 * (100% - 8px)); --pr: 3deg; --r: -2.5deg; --ty: 6px; }
.dsk-slip:nth-child(3) { z-index: 3; --px: calc(-.5 * (100% - 8px)); --pr: -1.5deg; --r: 2.5deg; --ty: 8px; }
.dsk-slip:nth-child(4) { z-index: 4; --px: calc(-1.5 * (100% - 8px)); --pr: 2deg; --r: 7deg; --ty: 28px; }
@media (hover: hover) {
  .dsk.spread:hover .dsk-slip { opacity: .82; }
  .dsk.spread .dsk-slip:hover { --r: 0deg; --ty: -30px; z-index: 6; opacity: 1; }
}
.dsk-slip:focus-visible { outline: 2px solid #CDA85F; outline-offset: 4px; z-index: 6; }
.dsk-slip.cv-from { visibility: hidden; }
.dsk-top { display: flex; flex-direction: column; padding-bottom: 12px; border-bottom: 1px dashed rgba(23,17,14,.3); }
.dsk-top b { font: 700 1.2rem/1.2 var(--serif); }
.dsk-top em, .dsk-l { font-style: normal; font-size: .8125rem; color: #5F5A55; }
.dsk-big { font: 700 clamp(2.6rem, 3.6vw, 3.4rem)/.95 var(--serif); letter-spacing: -0.03em; color: #7A5A16; margin-top: 6px; }
.dsk-rows, .dsk-ms { display: grid; gap: 5px; padding: 10px 0; border-top: 1px dashed rgba(23,17,14,.22); font: 600 .75rem/1.35 "IBM Plex Mono", ui-monospace, monospace; }
.dsk-r { display: flex; justify-content: space-between; gap: 12px; } .dsk-r span { color: #5F5A55; } .dsk-r b { text-align: right; }
.dsk-slip .bc { height: 30px; color: #17110E; opacity: .85; }
.dsk-go { font-weight: 600; font-size: .875rem; color: #7A5A16; }
@media (max-width: 900px) {
  .dsk { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding: 20px 4px 30px; scrollbar-width: none; }
  .dsk-slip { margin-left: 0; width: 78vw; max-width: 320px; scroll-snap-align: center; transform: none; }
}

/* ---------- the case receipt ---------- */
html.cv-lock { overflow: hidden; }
.cv { position: fixed; inset: 0; z-index: 95; perspective: 1800px; }
.cv-back { position: absolute; inset: 0; background: rgba(12,9,7,.72); opacity: 0; transition: opacity .45s var(--ease); }
.cv.open .cv-back { opacity: 1; }
.cv-card { position: fixed; color: #17110E; outline: none; contain: layout style; transform: var(--rot0, none); transform-style: preserve-3d;
  transition: left .8s var(--ease), top .8s var(--ease), width .8s var(--ease), height .8s var(--ease), transform .8s var(--ease); }
.cv.open .cv-card { transform: rotateY(180deg); }
.cv-face { position: absolute; inset: 0; background: #FAFAF8; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  -webkit-mask: radial-gradient(circle at 50% 0, transparent 5px, #000 5.6px) top / 18px 10px repeat-x, radial-gradient(circle at 50% 100%, transparent 5px, #000 5.6px) bottom / 18px 10px repeat-x, linear-gradient(#000, #000) center / 100% calc(100% - 18px) no-repeat;
  mask: radial-gradient(circle at 50% 0, transparent 5px, #000 5.6px) top / 18px 10px repeat-x, radial-gradient(circle at 50% 100%, transparent 5px, #000 5.6px) bottom / 18px 10px repeat-x, linear-gradient(#000, #000) center / 100% calc(100% - 18px) no-repeat; }
.cv-front { display: flex; padding: 30px 22px 22px; flex-direction: column; gap: 10px; }
.cv-full { transform: rotateY(180deg); }
.cv-in { position: absolute; inset: 0; overflow: hidden; padding: 34px clamp(20px, 4vw, 46px) 30px; }
.cv.done .cv-in { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* 11 Nov 2026: once the receipt has turned over it is laid flat. On iPhones a finger could not scroll inside a card that was still
   turned in 3D, so the swipe went to the page behind. Turned 180 degrees twice looks the same as not turned at all. */
.cv.done { perspective: none; }
.cv.done .cv-card { transform: none; transform-style: flat; transition: none; }
.cv.done .cv-full { transform: none; backface-visibility: visible; -webkit-backface-visibility: visible; }
.cv.done .cv-front { display: none; }
.cv-x { position: absolute; z-index: 3; top: 18px; right: 16px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(23,17,14,.16); background: #FFFFFF; color: #17110E;
  display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .3s var(--ease); }
.cv.done .cv-x { opacity: 1; }
.cv-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.cv-x:hover { border-color: #A9853D; } .cv-x:focus-visible { outline: 2px solid #A9853D; outline-offset: 3px; }
.cv-head { display: flex; flex-direction: column; gap: 10px; padding-right: 50px; }
.cv-head .dsk-big, .cv-front .dsk-big { font-size: clamp(3rem, 6vw, 4.8rem); }
.cv-head .dsk-rows { max-width: 460px; }
.cv-body { display: flex; flex-direction: column; }
.cv-body > * { opacity: 0; }
.cv.open .cv-body > * { animation: cvIn .5s var(--ease) both; }
.cv-body > :nth-child(1) { animation-delay: .5s; } .cv-body > :nth-child(2) { animation-delay: .56s; } .cv-body > :nth-child(3) { animation-delay: .62s; }
.cv-body > :nth-child(4) { animation-delay: .68s; } .cv-body > :nth-child(5) { animation-delay: .74s; } .cv-body > :nth-child(6) { animation-delay: .8s; }
.cv-body > :nth-child(7) { animation-delay: .86s; } .cv-body > :nth-child(8) { animation-delay: .92s; }
@keyframes cvIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cv-place { display: block; padding: 14px 0 4px; color: #5F5A55; font-size: .875rem; }
.cv-sec { padding: 14px 0; border-top: 1px dashed rgba(23,17,14,.22); }
.cv-k { display: block; margin-bottom: 8px; font: 600 .75rem/1.2 "IBM Plex Mono", monospace; color: #5F5A55; }
.cv-sec p { margin: 0; }
.cv-sec ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cv-sec li { position: relative; padding-left: 20px; } .cv-sec li::before { content: ""; position: absolute; left: 0; top: .72em; width: 11px; height: 1px; background: #A9853D; }
.cv-sec .dsk-r { font: 600 .8125rem/1.4 "IBM Plex Mono", monospace; padding: 4px 0; }
.cv-ba { display: grid !important; grid-template-columns: 1.1fr 1.4fr 1.4fr; } .cv-ba b { color: #7A5A16; text-align: right; }
.cv-cap { display: block; margin-top: 4px; font-size: .75rem; color: #5F5A55; }
.cv-m span em { display: block; font-style: normal; font-weight: 400; color: #8A837C; }
.cv-m b { font: 700 1.2rem/1.1 var(--serif); color: #7A5A16; white-space: nowrap; }
.cv-extra { margin: 6px 0 0; padding: 12px 14px; border-left: 2px solid #A9853D; background: rgba(205,168,95,.12); }
.cv-src { margin: 14px 0 10px; color: #5F5A55; font-size: .8125rem; }
.cv .bc { color: #17110E; height: 36px; }
.cv-act { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.cv .btn-line { color: #17110E; border-color: rgba(169,133,61,.6); } .cv .btn-line::before { background: #CDA85F; }
.cv .btn-gold { border: 1px solid #B08D45; } .cv .btn-gold::before { background: #17110E; }
@media (hover: hover) { .cv .btn-gold:hover { color: #CDA85F; } }
@media (prefers-reduced-motion: reduce) { .dsk-slip, .cv-card { transition: none; } .cv-body > * { opacity: 1; animation: none !important; } }

/* the case studies page does not exist yet (11 Oct): the button stays, but is not a link and has no hover */
.btn.btn-off { cursor: default; opacity: .55; } .btn.btn-off::before { display: none; }
.res .btn-line.btn-off, .res .btn-line.btn-off:hover { color: #F1E9DE; border-color: rgba(205,168,95,.55); box-shadow: none; }   /* 12 Oct: it went dark-on-dark on hover */
.cv .btn-line.btn-off, .cv .btn-line.btn-off:hover { color: #17110E; border-color: rgba(169,133,61,.6); }
