/* PreKon case study · /case-studies/prekon/ (markup: src/prekon.html, made by tools/prekon_page.py · motion: static/js/prekon.js)
   Coded from the Figma page "PreKon case study · Measure twice" (HPF case studies, node 113:649): 12 sheets, each 1920 wide.
   1200 px and wider: every sheet keeps its Figma artboard. --kp is one Figma px in screen px, min(1, page width / 1920), set by
   the page's inline script; .at elements sit at their Figma x, y (style="--x; --y"). .ab blocks are small artboards whose .ai
   children are placed in the block's own px (unit --lu), so a block can be scaled on its own below 1200.
   Type has a floor, so no text drops under 11 px. Below 1200 the same markup reflows into one column; from 700 to 1199 the tape
   still runs down the left edge, under 700 it becomes a strip across the top of each sheet.
   Type: Schibsted Grotesk, the Figma family. The tape: 1 in = 40 px, eighth ticks, inch numbers counting through the page. */

:root { --kp: min(1px, calc(100vw / 1920)); }
body.page-prekon { background: #F1F3F5; }
.pk { --ground: #F1F3F5; --ink: #23272E; --ink2: #575E68; --line: #D8DDE3; --tape: #F2C230; --tape-edge: #C99712; --tick: #1B1B1B;
  --steel: #6B717A; --steel-2: #575E68; --night: #23272E; --night-lead: #C3C9D1;
  --fe: cubic-bezier(.22, 1, .36, 1);
  --pf: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sh: 0 calc(2 * var(--kp)) calc(4 * var(--kp)) rgb(28 36 48 / .06), 0 calc(10 * var(--kp)) calc(20 * var(--kp)) rgb(28 36 48 / .07), 0 calc(28 * var(--kp)) calc(56 * var(--kp)) rgb(28 36 48 / .07);
  /* tape ticks, one inch per tile: inch line at y 20 (18 long), half inch at 0 and 40 (12), quarters (8) and eighths (5), from both edges */
  --ticks-v: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='40' viewBox='0 0 72 40'%3E%3Cg stroke='%231B1B1B' stroke-width='2'%3E%3Cpath d='M2 20H20M52 20H70M2 0H14M58 0H70M2 40H14M58 40H70'/%3E%3C/g%3E%3Cg stroke='%231B1B1B' stroke-width='1.25'%3E%3Cpath d='M2 10H10M62 10H70M2 30H10M62 30H70M2 5H7M65 5H70M2 15H7M65 15H70M2 25H7M65 25H70M2 35H7M65 35H70'/%3E%3C/g%3E%3C/svg%3E");
  --ticks-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='72' viewBox='0 0 32 72'%3E%3Cg stroke='%231B1B1B' stroke-width='2'%3E%3Cpath d='M16 2V20M16 52V70M0 2V14M0 58V70M32 2V14M32 58V70'/%3E%3C/g%3E%3Cg stroke='%231B1B1B' stroke-width='1.25'%3E%3Cpath d='M8 2V10M8 62V70M24 2V10M24 62V70M4 2V7M4 65V70M12 2V7M12 65V70M20 2V7M20 65V70M28 2V7M28 65V70'/%3E%3C/g%3E%3C/svg%3E");
  display: block; background: var(--ground); color: var(--ink); font-family: var(--pf); font-weight: 400; }
.pk h1, .pk h2, .pk p, .pk figure { margin: 0; }
.pk img { display: block; max-width: none; }
/* the top band: room for the fixed nav, then the breadcrumb (Case studies > PreKon) on the content's left edge */
.pk__band { padding: calc(var(--bar-top) + 64 * var(--u)) 40px calc(16 * var(--u)) 104px; }
@media (max-width: 899px) { .pk__band { padding-top: calc(var(--bar-top) + 80 * var(--u)); } }
@media (max-width: 699px) { .pk__band { padding-left: 20px; padding-right: 20px; } }
.pk-s { position: relative; isolation: isolate; overflow-x: clip; background: var(--ground); }
.pk-s--dark { background: var(--night); color: #fff; --ink: #fff; --ink2: var(--night-lead); }
.pk__stage { position: relative; }

/* ---------- type ---------- */
.pk-display, .pk-title, .pk-big { font-weight: 700; color: var(--ink); }
.pk-display { font-size: calc(104 * var(--kp)); line-height: 1; letter-spacing: -.025em; }
.pk-title { font-size: calc(72 * var(--kp)); line-height: 1.0556; letter-spacing: -.02em; }
.pk .l { display: block; white-space: nowrap; }
.pk-lead { width: calc(var(--w) * var(--kp)); font-size: max(16px, calc(26 * var(--kp))); line-height: 1.4615; color: var(--ink2); }
.pk-big { font-size: calc(144 * var(--kp)); line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.pk-big--tape { color: var(--tape); }
.pk-meta { width: calc(var(--w) * var(--kp)); font-weight: 500; font-size: max(11px, calc(16 * var(--kp))); line-height: 1.25; color: var(--ink2); }
.pk-meta--r { text-align: right; }
.pk-cap { display: grid; align-content: start; gap: calc(8 * var(--kp)); width: calc(var(--w) * var(--kp)); }
.pk-cap b { font-weight: 600; font-size: max(14px, calc(22 * var(--kp))); line-height: 1.2727; }
.pk-cap span { font-size: max(13px, calc(19 * var(--kp))); line-height: 1.3684; color: var(--ink2); }
.pk-logo { width: calc(var(--w) * var(--kp)); }
.pk-logo img { width: 100%; height: auto; }

/* ---------- sheets, windows and photos ---------- */
.pk-sheet, .pk-detail, .pk-photo, .pk-estimate { position: relative; overflow: hidden; width: calc(var(--w) * var(--kp)); height: calc(var(--hh) * var(--kp)); background: #fff; box-shadow: var(--sh); }
.pk-sheet { border-radius: calc(14 * var(--kp)); }
.pk-detail, .pk-photo { border-radius: calc(12 * var(--kp)); }
.pk-detail--r16 { border-radius: calc(16 * var(--kp)); }
.pk-photo--r8 { border-radius: calc(8 * var(--kp)); }
.pk-sheet::after, .pk-detail::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.pk-sheet img, .pk-detail img, .pk-photo img, .pk-estimate img { width: 100%; height: 100%; object-fit: cover; }
.pk-estimate { border-radius: calc(16 * var(--kp)); box-shadow: 0 calc(2 * var(--kp)) calc(4 * var(--kp)) rgb(0 0 0 / .35), 0 calc(12 * var(--kp)) calc(24 * var(--kp)) rgb(0 0 0 / .3), 0 calc(32 * var(--kp)) calc(64 * var(--kp)) rgb(0 0 0 / .3); }
.pk-line { position: absolute; left: calc(120 * var(--kp)); top: 0; width: calc(1800 * var(--kp)); height: 1px; background: var(--line); }
.pk-strip { display: none; }

/* ---------- artboards: appliance groups, the cabinet ruler, the upper cabinet ---------- */
.ab { --lu: var(--kp); }
.ai { position: absolute; left: calc(var(--x) * var(--lu)); top: calc(var(--y) * var(--lu)); width: calc(var(--w) * var(--lu)); height: calc(var(--hh) * var(--lu)); }
.pk-floor { border-radius: 50%; background: #D3D8DE; filter: blur(calc(3 * var(--lu))); }
.pk-appl img { width: 100%; height: 100%; object-fit: contain; }
.pk-glabel, .pk-gcount { width: calc(var(--w) * var(--kp)); text-align: center; }
.pk-glabel b { font-weight: 600; font-size: max(14px, calc(22 * var(--kp))); line-height: 1.2727; }
.pk-gcount { font-size: max(13px, calc(19 * var(--kp))); line-height: 1.3684; color: var(--ink2); }
.ruler { background: var(--ticks-h) calc(8 * var(--lu)) 0 / calc(32 * var(--lu)) calc(72 * var(--lu)) repeat-x, var(--tape);
  box-shadow: inset 0 calc(2 * var(--lu)) var(--tape-edge), inset 0 calc(-2 * var(--lu)) var(--tape-edge), 0 0 calc(3 * var(--lu)) rgb(28 36 48 / .16); }
.ruler__n { position: absolute; left: calc((var(--x) - 15) * var(--lu)); top: calc(29 * var(--lu)); width: calc(30 * var(--lu)); height: calc(14 * var(--lu));
  display: grid; place-items: center; font: 700 max(11px, calc(13 * var(--lu)))/1 var(--pf); color: var(--tick); }
.ruler__n--ft { left: calc((var(--x) - 17) * var(--lu)); top: calc(25 * var(--lu)); width: calc(34 * var(--lu)); height: calc(22 * var(--lu)); border-radius: calc(3 * var(--lu)); background: var(--tick); color: var(--tape); }
.pk-pill, .pk-mtag { display: grid; place-items: center; border-radius: 999px; font-weight: 500; font-size: max(11px, calc(16 * var(--lu))); line-height: 1.25; white-space: nowrap; }
.pk-pill { background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.pk-pin { width: max(1px, calc(1 * var(--lu))); background: var(--ink2); }
.pk-mark { background: var(--ink); transform-origin: 50% 0; }
.pk-mtag { background: var(--ink); color: #fff; }

/* ---------- finish samples ---------- */
.pk-sample { display: flex; flex-direction: column; width: calc(var(--w) * var(--kp)); }
.pk-sample__img { position: relative; display: block; height: calc(190 * var(--kp)); border-radius: calc(8 * var(--kp)); overflow: hidden; box-shadow: var(--sh); }
.pk-sample__img img { width: 100%; height: 100%; object-fit: cover; }
.pk-ring { position: absolute; left: calc(16 * var(--kp)); top: calc(16 * var(--kp)); width: calc(16 * var(--kp)); height: calc(16 * var(--kp)); border-radius: 50%; background: var(--ground); box-shadow: inset 0 calc(1 * var(--kp)) calc(2 * var(--kp)) rgb(28 36 48 / .25); }
.pk-sample b { margin-top: calc(16 * var(--kp)); font-weight: 500; font-size: max(13px, calc(16 * var(--kp))); line-height: 1.25; }
.pk-sample__code { margin-top: calc(8 * var(--kp)); font-size: max(13px, calc(16 * var(--kp))); line-height: 1.25; color: var(--ink2); }

/* ---------- the tape measure ---------- */
.tape { position: absolute; left: calc(48 * var(--kp)); top: 0; z-index: 2; width: calc(72 * var(--kp)); height: calc(var(--th) * var(--kp));
  background: var(--ticks-v) 0 calc(var(--o) * -1 * var(--kp)) / calc(72 * var(--kp)) calc(40 * var(--kp)) repeat-y, var(--tape);
  box-shadow: inset calc(2 * var(--kp)) 0 var(--tape-edge), inset calc(-2 * var(--kp)) 0 var(--tape-edge), 0 0 calc(3 * var(--kp)) rgb(28 36 48 / .16); }
.tape__n { position: absolute; left: calc(16 * var(--kp)); top: calc(var(--y) * var(--kp)); width: calc(40 * var(--kp)); height: calc(14 * var(--kp)); margin-top: calc(-7 * var(--kp));
  display: grid; place-items: center; font: 700 max(11px, calc(13 * var(--kp)))/1 var(--pf); color: var(--tick); }
.tape__n--ft { left: calc(14 * var(--kp)); width: calc(44 * var(--kp)); height: calc(22 * var(--kp)); margin-top: calc(-11 * var(--kp)); border-radius: calc(3 * var(--kp)); background: var(--tick); color: var(--tape); }
.tape__hook { position: absolute; left: calc(-12 * var(--kp)); top: 0; width: calc(96 * var(--kp)); height: calc(72 * var(--kp)); }
.tape__lip { position: absolute; left: 0; top: 0; z-index: 1; width: 100%; height: calc(14 * var(--kp)); background: var(--steel-2); }
.tape__plate { position: absolute; left: calc(12 * var(--kp)); top: 0; width: calc(72 * var(--kp)); height: calc(64 * var(--kp)); border-radius: 0 0 calc(6 * var(--kp)) calc(6 * var(--kp)); background: var(--steel); box-shadow: var(--sh); }
.tape__plate i { position: absolute; top: calc(36 * var(--kp)); width: calc(10 * var(--kp)); height: calc(10 * var(--kp)); border-radius: 50%; background: var(--line); }
.tape__plate i:first-child { left: calc(17 * var(--kp)); }
.tape__plate i:last-child { left: calc(45 * var(--kp)); }
.tape-housing { z-index: 3; width: calc(248 * var(--kp)); height: calc(248 * var(--kp)); border-radius: calc(56 * var(--kp)); background: var(--tick);
  box-shadow: 0 calc(4 * var(--kp)) calc(8 * var(--kp)) rgb(28 36 48 / .12), 0 calc(16 * var(--kp)) calc(32 * var(--kp)) rgb(28 36 48 / .12), 0 calc(40 * var(--kp)) calc(80 * var(--kp)) rgb(28 36 48 / .12); }
.tape-housing__grip { position: absolute; inset: calc(20 * var(--kp)); border-radius: calc(36 * var(--kp)); background: var(--tape); }
.tape-housing__grip img { position: absolute; left: calc(24 * var(--kp)); top: calc(85 * var(--kp)); width: calc(160 * var(--kp)); height: auto; }
.tape-housing__slot, .tape-housing__lock { position: absolute; z-index: 1; border-radius: calc(6 * var(--kp)); background: var(--steel-2); }
.tape-housing__slot { left: calc(16 * var(--kp)); top: calc(-6 * var(--kp)); width: calc(88 * var(--kp)); height: calc(18 * var(--kp)); }
.tape-housing__lock { left: calc(148 * var(--kp)); top: calc(-8 * var(--kp)); width: calc(60 * var(--kp)); height: calc(16 * var(--kp)); }

/* ---------- 1200 and wider: the Figma sheets ---------- */
@media (min-width: 1200px) {
  .bar--pk .bar__in { width: calc(1584 * var(--kp)); margin-left: calc((100% - 1920 * var(--kp)) / 2 + 224 * var(--kp)); }
  .pk__band { padding-left: calc((100% - 1920 * var(--kp)) / 2 + 224 * var(--kp)); }
  .pk-s { height: calc(var(--h) * var(--kp)); }
  .pk__stage { width: calc(1920 * var(--kp)); height: 100%; margin: 0 auto; }
  .pk .g { display: contents; }
  .pk .at { position: absolute; left: calc(var(--x) * var(--kp)); top: calc(var(--y) * var(--kp)); }
  .ab { width: calc(var(--aw) * var(--kp)); height: calc(var(--ah) * var(--kp)); }
}

/* ---------- below 1200: one column ---------- */
@media (max-width: 1199px) {
  .pk { --kp: .667px; }
  .pk-s { padding: 96px 40px 104px 104px; }
  .pk__stage { position: static; display: flex; flex-direction: column; gap: 40px; max-width: 920px; }   /* static: the tape, its hook and housing anchor to the sheet's edge */
  .pk .at { position: relative; }
  .tape { left: 24px; height: 100%; }
  .tape__n { display: none; }
  .pk-s--s12 { padding-bottom: calc(104px + 248 * var(--kp)); }   /* room for the housing under the last photo */
  .pk-s--s12 .tape { height: calc(100% - 56px - 242 * var(--kp)); }   /* the blade ends inside the housing's slot */
  .pk .tape-housing.at { position: absolute; left: calc(24px - 24 * var(--kp)); bottom: 56px; }
  .pk-line { left: 0; width: 100%; }
  .pk-display { font-size: clamp(40px, 6.6vw, 72px); line-height: 1.04; }
  .pk-title { font-size: clamp(32px, 5.2vw, 56px); line-height: 1.08; }
  .pk .l { display: inline; white-space: normal; }
  .pk-display, .pk-title { text-wrap: balance; }
  .pk-lead { width: auto; max-width: 36em; font-size: clamp(17px, 2.1vw, 20px); line-height: 1.5; text-wrap: pretty; }
  .pk-lead br { display: none; }
  .pk-big { font-size: clamp(48px, 10vw, 112px); white-space: normal; text-wrap: balance; }
  .pk-meta, .pk-cap, .pk-glabel, .pk-gcount, .pk-sample { width: auto; }
  .pk-meta { font-size: 14px; }
  .pk-meta--r { text-align: left; }
  .pk-cap { gap: 4px; }
  .pk-cap b { font-size: 17px; line-height: 24px; }
  .pk-cap span { font-size: 15px; line-height: 22px; }
  .pk-logo { width: 150px; }
  .pk-head { display: flex; flex-direction: column; gap: 16px; }
  .pk-head--cover .pk-display { margin-top: 8px; }
  .pk-head--close .pk-logo { margin-top: 8px; }
  .pk-fig { display: flex; flex-direction: column; gap: 16px; }
  .pk-pair { display: flex; flex-direction: column; gap: 40px; }
  .pk-pair--keep { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .pk-bigset { display: flex; flex-direction: column; gap: 12px; }
  .pk-sheet, .pk-detail, .pk-photo, .pk-estimate { width: 100%; height: auto; aspect-ratio: var(--w) / var(--hh); }
  .pk-sheet { border-radius: 10px; }
  .pk-detail, .pk-photo, .pk-estimate { border-radius: 10px; }
  .pk-photo--r8 { border-radius: 8px; }

  /* appliances: a 2 x 2 grid, every group drawn at one scale (the cooking group fills its column) */
  .pk-lineup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; align-items: end; }
  .pk-agroup { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .pk-floorbox { width: calc(var(--aw) / 567 * 100%); aspect-ratio: var(--aw) / var(--ah); container-type: inline-size; margin-bottom: 8px; }
  .pk-floorbox .ai { --lu: calc(100cqw / var(--aw)); }
  .pk-glabel b { font-size: 17px; line-height: 24px; }
  .pk-gcount { font-size: 14px; line-height: 20px; }

  /* the cabinet ruler keeps its drawing and scrolls sideways */
  .pk-rulerwrap { overflow-x: auto; margin: 0 -40px 0 0; padding: 8px 40px 16px 0; scrollbar-width: none; }
  .pk-rulerwrap::-webkit-scrollbar { display: none; }
  .pk-ruler { --lu: .64px; width: calc(1584 * var(--lu)); height: calc(176 * var(--lu)); }
  .pk-cabbox { width: min(100%, 512px); aspect-ratio: 512 / 405; container-type: inline-size; }
  .pk-cabbox .ai { --lu: calc(100cqw / 512); }

  .pk-samples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .pk-sample__img { height: auto; aspect-ratio: 368 / 190; border-radius: 8px; }
  .pk-sample b { margin-top: 12px; font-size: 15px; line-height: 20px; }
  .pk-sample__code { margin-top: 4px; font-size: 14px; line-height: 20px; }
}
@media (max-width: 699px) {
  .pk-s { padding: 72px 20px 80px; }
  .pk__stage { gap: 32px; }
  .tape, .tape-housing { display: none; }
  .pk-line { display: none; }
  .pk-strip { display: block; position: absolute; left: 0; right: 0; top: 0; height: 26px; --lu: .36px;
    background: var(--ticks-h) 0 0 / calc(32 * var(--lu)) 26px repeat-x, var(--tape); box-shadow: inset 0 1px var(--tape-edge), inset 0 -1px var(--tape-edge); }
  .pk-rulerwrap { margin-right: -20px; padding-right: 20px; }
  .pk-pair--keep { gap: 12px; }
  .pk-samples { gap: 20px 12px; }
}

/* ---------- motion (static/js/prekon.js adds .is-in); nothing hides without JS or with reduced motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .pk [data-fr] { transition: opacity .9s var(--fe), translate 1s var(--fe); transition-delay: calc(var(--i, 0) * 110ms); }
  .js .pk [data-fr]:not(.is-in) { opacity: 0; translate: 0 calc(40 * var(--kp)); }
  /* appliances settle onto the floor one by one, their shadows spread */
  .js .pk .pk-floorbox .pk-appl { transition: translate .9s var(--fe), opacity .6s ease; }
  .js .pk .pk-floorbox .pk-appl:nth-of-type(2) { transition-delay: .12s; }
  .js .pk .pk-floorbox:not(.is-in) .pk-appl { translate: 0 calc(-28 * var(--lu)); opacity: 0; }
  .js .pk .pk-floorbox .pk-floor { transition: scale .9s var(--fe), opacity .6s ease; }
  .js .pk .pk-floorbox:not(.is-in) .pk-floor { scale: .5 1; opacity: 0; }
  /* the ruler: widths drop onto their pins left to right, then the pencil marks 31.5 */
  .js .pk .pk-ruler .pk-pill { transition: translate .7s var(--fe), opacity .45s ease; transition-delay: calc(var(--i) * 70ms + 300ms); }
  .js .pk .pk-ruler:not(.is-in) .pk-pill { translate: 0 calc(-16 * var(--lu)); opacity: 0; }
  .js .pk .pk-ruler .pk-mark { transition: scale .8s var(--fe) 1.4s; }
  .js .pk .pk-ruler:not(.is-in) .pk-mark { scale: 1 0; }
  .js .pk .pk-ruler .pk-mtag { transition: opacity .5s ease 1.9s, scale .7s var(--fe) 1.9s; }
  .js .pk .pk-ruler:not(.is-in) .pk-mtag { opacity: 0; scale: .6; }
  /* the hook drops onto the cover, the housing takes the blade in at the end */
  .js .pk .tape__hook { transition: translate 1s var(--fe) .25s; }
  .js .pk:not(.is-ready) .tape__hook { translate: 0 calc(-72 * var(--kp)); }
  .js .pk .tape-housing { transition: opacity .9s var(--fe), translate 1.1s var(--fe); }
}
